| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Add quantity input box within product list grid for Crisp White Skin | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Add quantity input box within product list grid for Crisp White Skin
http://caramarine.com/new-arrivals -> On the product list page for any category, I have hidden Add to Cart button and it shows up only if user is logged in.
Page Link How can I add a quantity box within the product grid so that when a logged in user clicks on "Add to Cart", the specified quantity of the product gets added to cart ? See attached screenshot. Currently, quantity gets added as 1 in cart and there I need option to specify quantity directly on product list page before adding to cart.
__________________
X Cart -> 5.3.1.3 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Add quantity input box within product list grid for Crisp White Skin
This action is performed in background via an AJAX call from this JavaScript file:
skins/customer/items_list/product/products_list.js The function that performs the call is this one: ProductsListView.prototype.addToCart = function (elem) {} The template file that renders the button in product grids is this one: skins/customer/items_list/product/parts/grid.button-add2cart-wrapper.twig If you check the file, you will see that the button is injected into "itemsList.product.grid.customer.tail" list. So, to add the quantity selector you should: 1. Create a custom module 2. In the module create a new template file that will inject the input box into the same "itemsList.product.grid.customer.tail" list (use the "weight" attribute to control a position of the widget among others in this list). 3. In the module create a new JS file that will replace ProductsListView.prototype.addToCart with your custom function that will pass the specified quantity in the "add-to-cart" request to the server. 4. In the module "decorate" \XLite\View\ItemsList\Product\AProduct class and make the getJSFiles() method load your JS file.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
|||
X-Cart forums © 2001-2020
|