Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Easy Populate's $attribute_value_price_prefix help


Recommended Posts



I'm trying to modify the code for Easy Populate so it will work with Actaul Attribute.


All Actaul Attribute is is that if you have a blank attribute prefix (vs. '-' or '+'), it will show the actaul value of the attribute in the shopping cart vs. showing the difference.


For example, if I have Product A which is $10. I can either have an attribute for Base Product A Version 2.0 for $2 (w/ prefix '+') or i can directly enter $12 (w/ prefix ''). //left blank


I'm using Easy Populate to enter in all the attributes and attribute values, and my solution to see whether or not we should have "+", "-", or "" (blank) is to simply check whether the attribute value is higher than the product price. If it is higher than we will simply leave the attribute prefix blank because we will assume that is the actual price of the product. If the attribute price is between $0 and it is less than the actaul product price, then we will put a a "+" on there becuase we know that this is the additonal price that you have to pay aside from the base price.





//original code
  	 $attribute_values_price_prefix = ($$v_attribute_values_price_var < 0) ? '-' : '+';

//My Code: sets the attribute prefix to '-' if the value price of the attribute value is less than 0
                       if($$v_attribute_values_price_var < 0)
           {$attribute_value_price_prefix = '-';}

//My Code: sets the attribute price prefix to + if the value price is less than the actaul price
     else if($$v_attribute_values_price_var >= $v_products_price)
        {$attribute_value_price_prefix = '';}
//My Code: sets the attribute prefix to '' if the value price of the attribute is greater or equal to the actaul price
        {$attribute_values_price_prefix = '+';}




Can someone pleaes help me out here? I think it's the middle line that is "else if" statement that is causing the problem. is "$v_products_price" the right variable to compare the attribute price to? Please advise.


Thanks for your time!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...