Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
389 views
in Technique[技术] by (71.8m points)

html - Need help adding a button to product category page with a if statement in EpiServer

I am having trouble figuring out how to implement a button that will link to a product page from my category page. Right now, I have a way for our customers to add products from the category page with quantity and add to cart buttons. Shown Below

Category Image

As you can see on the left, I need a button that will go directly to the product page with additional prices that says "View Details".

Here is the code that I currently have:

<td ng-class="{ noToggle: !product.canAddToCart }" class="tv-last-column">
                                        <div class="actions-block">
                                            <div ng-if="product.canAddToCart" class="product-info">
                                                <div class="um-pack">
                                                    <div class="um">
                                                        <label ng-if="vm.settings.alternateUnitsOfMeasure && product.productUnitOfMeasures.length > 1">[% translate 'U/M' %]:</label>
                                                        <isc-unit-of-measure-select-list product="product" alternate-units-of-measure="{{vm.settings.alternateUnitsOfMeasure}}" change-unit-of-measure="vm.changeUnitOfMeasure(product)" display-pack="true"></isc-unit-of-measure-select-list>
                                                    </div>
                                                </div>
                                            </div>
                                            <div ng-if="product.canAddToCart" class="add-to-cart-block">
                                                <div ng-if="product.canEnterQuantity" class="item-qty">
                                                    <input type="text" name="qty" ng-model="product.qtyOrdered" class="qty numerictextbox" />
                                                </div>
                                                <div class="action">
                                                    <button id="tst_productList_{{product.id}}_addToCart" ng-click="vm.addToCart(product)" href="javascript:void(0);" class="btn-add-cart btn primary" ng-disabled="!product.qtyOrdered || product.qtyOrdered == 0 || vm.addingToCart">[% translate 'Add To Cart' %]</button>
                                                </div>
                                            </div>
                                            <a id="tst_productList_{{product.id}}_addToWishList" ng-show="product.canAddToWishlist" ng-click="vm.openWishListPopup(product)" role="button" class="btn secondary btn-add-list" href="javascript:void(0);">[% translate 'Add to List' %]</a>
                                        </div>
                                    </td>

Here is what I am trying to achieve:

Achievment


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...