| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Is there a way to get a specific attribute value? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Is there a way to get a specific attribute value?
So I want to grab an attribute I created "Pieces Per Case" and add it to
default/en/common/price_parts/price.tpl How do I specifically get the value of the attribute to modify Code:
I would like the end result to be <li><span class="price product-price">{formatPrice(getListPrice(),null,1):h}</span><span> per case (##AttributeValue## Pieces Per Case</span></li> Edit: It looks like the attribute is <select class="form-control" name="attribute_values[50]" data-attribute-id="50"> <option selected="selected" value="371">12</option> <option value="372">36 (+$42.00)</option> <option value="540">100 (+$125.00)</option> </select> Also I really wish i could change the +$42.00 and +125.00 to just be the price of those values... if default is $30.00 which it just said 36 ($72.00) and 100 ($150.00)... A lot of customers have said the + is confusing.
__________________
Business License https://glaspak.com GoDaddy VPS - Apache with WHM 2GB ECC DDR3 1600MHz 2x Intel E5-2630L v2 Hex Core 2.4/2.8ghz 15 MB proc cache 60 GB 10k RPM hdd PHP 7.0.15 MariaDB 10.1.21 with InnoDB engine |
|||||||||
#2
|
|||||||||
|
|||||||||
Re: Is there a way to get a specific attribute value?
You should look into creating a custom module that will decorate \XLite\View\Product\AttributeValue\Customer\Select ::getModifierTitle() method and change the way how it displays the modifier surcharge.
Another method that you may to customize is \XLite\Model\AttributeValue\AttributeValueSelect:: formatModifier().
__________________
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 |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: Is there a way to get a specific attribute value?
Quote:
I couldn't find AttributeValueSelect when I looked for it.
__________________
Business License https://glaspak.com GoDaddy VPS - Apache with WHM 2GB ECC DDR3 1600MHz 2x Intel E5-2630L v2 Hex Core 2.4/2.8ghz 15 MB proc cache 60 GB 10k RPM hdd PHP 7.0.15 MariaDB 10.1.21 with InnoDB engine |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: Is there a way to get a specific attribute value?
Quote:
It is in the [XC5]/classes/XLite/Model/AttributeValue/AttributeValueSelect.php file. But you should not edit the file directly. Instead create a custom module that decorates the methods of the class that you want to change. Please refer to the documentation for developers at http://kb.x-cart.com/
__________________
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
|