Jump to content

Changing Attribute Impact Price to a Static Price


Ba5ik7

Recommended Posts

Hey All,

First of all I want to thank all the developers for sharing this great ecom app. Ok my client needed 8 price tears for the customers. Once the in user logs in they see a new price depending on the price tear that has been assigned in the BO. I've been able to make all the changes needed for this to work.(Updated DB, Classes, BO Tabs, etc.) So the static prices display fine. I also needed to make the attributes have a static price... So I've got everything setup in the BO where it saves the price tears for the attributes and thats working fine. Now I need to display the price when the attributes are updated. I started with product.tpl in the themes dir looking for the event that fires the method that updates the price and found


onchange="[removed]findCombination();{if $colors|@count > 0}$('#resetImages').show('slow');{/if}"




Following the rabbit down the hole I look into product.js, also in the themes dir, to find that method. Well I found the function but it seems that it needs a pram. I'm a AS3 programmer and if the pram isn't null then there has to be some data type pass through.


JS function findCombination(firstTime)



AS3 function findCombination(firstTime:*=null)




I think to myself that this must be fired the firstTime Haha. I remembered when working with the BO I had to change attributeBack.js in order to update the BO product attribute form so I check the root js dir and BAM attributteFront.js But didn't find that method :( OK back into the product.js and product.tpl Stepping through the code in the product.js I find


selectedCombination['price'] = combinations[combination]['price'];



and

updateDisplay();



and

var combinations = new Array();
var selectedCombination = new Array();



So inside this for each in loop I see that price is being "pushed" into selectedCombination['price']. Well where is combinations[0]['price'] coming from? And in the updateDisplay() it seems that tax and sales are being applied not the price impact so where is this being possess? Am I looking over something in the product class? Please help guys I'm bugin out here O_o.


Many thanks - Wes

PS I've been tracking all my notes on how to do all of this on Tomboys Notes(ubuntu) and will gladly share. Step by step

Link to comment
Share on other sites

Ok I found these two post which has help a lot

http://www.prestashop.com/forums/viewthread/52441/configuring___using_prestashop/adding_atribute_as_a_percentage_increase

http://www.prestashop.com/forums/viewthread/29219/third_party_modules/variable_to_display_attribute_price


Using the info from them I've been able to get somewhere. It will take few hours to set this up to my needs, once done I'll post how I was able to do it. It will be quick and dirty. ;)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...