| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Get attribute multi values from attribute name ? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Get attribute multi values from attribute name ?
Hi ,
I am developing a custom module to get attribute multi select values from its name . I am not able to find any inbuilt functions to do so. Any suggestions will be greatly appreciated. Thanks, Lakin Xcart 5.3.5.5
__________________
xcart 4.7 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Get attribute multi values from attribute name ?
Try doing a search - see
classes/XLite/Model/Repo/Attribute.php protected function prepareCndName classes/XLite/Model/Repo/AttributeOption.php public function findOneByNameAndAttribute
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#3
|
|||||||
|
|||||||
Re: Get attribute multi values from attribute name ?
Quote:
Thanks . It really helped. Can we place indivisual add to cart buttons for each attribute ? If yes , then how can we handle add to cart. Please suggest.
__________________
xcart 4.7 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Get attribute multi values from attribute name ?
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.
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#5
|
|||||||
|
|||||||
Re: Get attribute multi values from attribute name ?
Quote:
<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 |
|||||||
|
|||
X-Cart forums © 2001-2020
|