View Single Post
  #5  
Old 09-04-2018, 10:40 AM
 
lakin1 lakin1 is offline
 

Member
  
Join Date: Feb 2018
Posts: 12
 

Default Re: Get attribute multi values from attribute name ?

Quote:
Originally Posted by cflsystems
I am sure you can. You have to see how the product has the button and what params passes to it for the action "add to cart".
However it may be a little bit tricky to do that for each variant - depends where you have the list.
XC is coded so almost the whole page is inside "form" tag - this was mentioned to them years ago as something that should not be this way but it is still like this. They may never fix it. You will have to have the list outside the form for starter and then call the add to cart widget for each item in the list with its own parameters.

<form action="?target=cart" method="post" accept-charset="utf-8" class="custom-add2cart">
<input type="hidden" name="target" value="cart" />
<input type="hidden" name="action" value="add" />
<input type="hidden" name="product_id" value="{{this.getProduct().getId()}}" />
<input type="hidden" name="attribute_values[{{attribute['id']}}]" value="{{attribute['select_attribute_id']}}" />
<div class="add-button-wrapper widget-fingerprint-product-add-button">
<button type="submit" class="btn regular-button regular-main-button add2cart submit">
<span>Add to cart</span>
</button>
</div>
</form>


I added above code and its adding product attribute as per its value.
But i ma facing one problem with price.
I mean , how can i override default product price calculation per attribute ?
__________________
xcart 4.7
Reply With Quote