Jump to content

Complex logic in the cart: checking amounts of some items


Social4U

Recommended Posts

Hello! 

I want to add a logic at the time of checkout, I need help.

I want to check that when added to cart specific references, the sum of the amounts is a multiple of 6. If not multiple should show a warning message, or even disable the button to complete the purchase ... 

 

I guess I should get an algorithm that: 

 

For each line from cart 

    If line.reference belongs to (conflictive_references) 

     amount = amount + linea.amount; 

   end If 

End for 

If number mod 6> 0 

  Warn / Ban Cart 

End If

 

Where should I code? Use the Prestashop 1.5.6 and the theme LeoWInes, I located the shopping-cart cart.tpl and-product-line.tpl, but do not know how to communicate with each other to make checking ... 

 

Thank you very much! Any help is welcome.

 

(and sorry for my English :( )

 

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...