Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Final price on product page - where/how is that calculated?  (Read 6594 times)

Offline cookie

  • Jr. Member
  • **
  • Posts: 65
  • Karma: +10/-0
    • View Profile
Final price on product page - where/how is that calculated?
« on: January 10, 2014, 09:43:48 AM »
Hi hi,

An other question :)

I could not figure out how/where the final price on the product page is calculated (the updated price on bottom of the product page, after options if options are used), can you help?

And where's the formula to calculate that final updated price ?!

I want to achieve smth like this for some of the products (so I'll 1st need to set an "if" array to apply to those product IDs only - and have no clue how to define that?)):

I'd use options to add variable parts to the product, each variable having a different weight. I was thinking to define that weight in % but have a rule which does not allow the summ of all chosen options together to be larger than 100 (like 100% is the maximum possible, right?). Like having a product where the customer could chose the % of each ingredient, making sure the max. % is not higher than 100%)

Can you help me with that?

Thank you!




Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Final price on product page - where/how is that calculated?
« Reply #1 on: January 11, 2014, 12:45:35 PM »
How is this a support thread?  ???

This is a customization. I move this to right location.

If you intend to change price calculation, you need to know PHP coding.

Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline cookie

  • Jr. Member
  • **
  • Posts: 65
  • Karma: +10/-0
    • View Profile
Re: Final price on product page - where/how is that calculated?
« Reply #2 on: January 11, 2014, 05:36:04 PM »
well, I don't know what it is, fact is I am still in the stage of evaluating what the cart can do and if I could use it  :-\
So before talking about any customizations I 1st need to know if this cart is the solution in the 1st place.

I was just looking for information about where those price calculations happen and how are the variables called so that I know what I search for ...

Could you help by answering that?

Is smth like what I wrote doable with this cart ?

Thank you in advance!
« Last Edit: January 11, 2014, 07:41:08 PM by cookie »

Offline eCommerce Core

  • Administrator
  • Hero Member
  • *****
  • Posts: 1602
  • Karma: +93/-1
    • View Profile
Re: Final price on product page - where/how is that calculated?
« Reply #3 on: January 11, 2014, 09:44:00 PM »
Regardless of your project stage, your question is related to customization and not normal support. I have to agree on this.

AbanteCart is very flexible and many things are possible, but it is recommended to use extension development to add features.
I suggest you read on dev manual and concepts:
http://www.abantecart.com/document_wiki/index.php/Main_Page

To answer your question.
Quote
I could not figure out how/where the final price on the product page is calculated (the updated price on bottom of the product page, after options if options are used), can you help?

And where's the formula to calculate that final updated price ?!

Look at this file:
https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/controller/pages/product/product.php

You need lines 178 thru 228

Note $this->data array is pushed to the template and  $this->data['product_price'] becomes $product_price in the template product.tpl.

Hope this helps.
“If you’re in the luckiest one per cent of humanity, you owe it to the rest of humanity to think about the other 99 per cent.”
― Warren Buffett

 

Powered by SMFPacks Social Login Mod