Jump to content

[NEED HELP] - Use Product Variants Select in Cart


Recommended Posts

Hi guys,

I'm developping a cross sell module that will display produtcs in cart that you can add to cart by clicking the button add to cart.

I need to take consideration of product variants (attributes).

I've already find out how to add the add to cart button to the cart page thanks to this code :

<form action="{$urls.pages.cart}" method="post" id="add-to-cart-or-refresh">
            <input type="hidden" name="token" value="{$static_token}">
            <input type="hidden" name="id_product" value="{$product->id}" id="product_page_product_id">
            <span class="remove-from-cart">
                <button class="btn btn-primary add-to-cart" data-button-action="add-to-cart" type="submit"
                    {if (!$product->checkQty(1))} disabled {/if}>
                    <i class="material-icons float-xs-left">shopping_cart</i>
                    {l s="Add to cart" d='Shop.Theme.Actions'}
                </button>
            </span>
        </form>

But what I need now is to update the display price depending about the value choosen with the select option value dropdown set as on my product page and use the attribute id selected in order than when the user click on the add to cart button, it add to cart the product with the good attribute and not the default one

I'm sure that is from js script that the price is updated but I don't really find ou which function is in charge of this

Waiting for your help guys ! 😉

Edited by jmauclair
title (see edit history)
Link to comment
Share on other sites

  • jmauclair changed the title to [NEED HELP] - Use Product Variants Select in Cart

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...