Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Is there a way to get a specific attribute value?

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 07-29-2015, 06:29 AM
  GlasPak's Avatar 
GlasPak GlasPak is offline
 

eXpert
  
Join Date: May 2015
Posts: 241
 

Default 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:
<li><span class="price product-price">{formatPrice(getListPrice(),null,1):h}</span><span> per case</span></li>

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
Reply With Quote
  #2  
Old 07-30-2015, 10:13 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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
Reply With Quote
  #3  
Old 08-05-2015, 04:14 AM
  GlasPak's Avatar 
GlasPak GlasPak is offline
 

eXpert
  
Join Date: May 2015
Posts: 241
 

Default Re: Is there a way to get a specific attribute value?

Quote:
Originally Posted by qualiteam
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().

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
Reply With Quote
  #4  
Old 08-08-2015, 02:15 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Is there a way to get a specific attribute value?

Quote:
Originally Posted by GlasPak
I couldn't find AttributeValueSelect when I looked for it.

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
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:00 PM.

   

 
X-Cart forums © 2001-2020