Zen Cart Logo
Forums / General Questions / Hi...some advice please...

Hi...some advice please...

Views: 568

Results 1 to 5 of 5
9 Jul 2016, 1:16 AM
#1
yaseent avatar

yaseent

Zen Follower

Join Date:
Mar 2009
Posts:
169
Plugin Contributions:
1

Hi...some advice please...

Hi there,

I'm busy with some slight modifications...

Can anyone tell me what the following lines of code are used for?
in catalog/includes/classes/order.php

Line 917:

  // update totals counters
  $this->total_weight += ($this->products[$i]['qty'] * $this->products[$i]['weight']);
  $this->total_tax += zen_calculate_tax($total_products_price * $this->products[$i]['qty'], $products_tax);
  $this->total_cost += $total_products_price;

  $this->notify('NOTIFY_ORDER_PROCESSING_ONE_TIME_CHARGES_BEGIN', $i);

I used Deveopers Toolkit to see if I can find any references to any of these variables/defines...but I can't pick up anything...

Any help would be much loved thank you :)

9 Jul 2016, 1:41 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Hi...some advice please...

These variables are used to total up each of the respective values: weight, tax, total cost, and then the "constant" is actually a notifier that is used to observe the data and take action if so desired.

As far as finding these things using the DTK, you would want to search on things like: total_weight, total_tax, or total_cost...

The constant is not likely to be found elsewhere in default ZC code because the code is written to operate mostly by direct flow.

9 Jul 2016, 1:46 AM
#3
yaseent avatar

yaseent

Zen Follower

Join Date:
Mar 2009
Posts:
169
Plugin Contributions:
1

Re: Hi...some advice please...

Hi mc12345678,

ah I see now...thanks so much!

10 Jul 2016, 7:20 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Hi...some advice please...

mc12345678:

These variables are used to total up each of the respective values: weight, tax, total cost, and then the "constant" is actually a notifier that is used to observe the data and take action if so desired.

As far as finding these things using the DTK, you would want to search on things like: total_weight, total_tax, or total_cost...

The constant is not likely to be found elsewhere in default ZC code because the code is written to operate mostly by direct flow.
Actually, it's not a constant. It's just a string. We happen to have embraced the use of uppercase letters when naming notifier hooks; but they're not actually constants even though they look like them.

11 Jul 2016, 9:32 PM
#5
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,695
Plugin Contributions:
56

Re: Hi...some advice please...

Indeed, you can tell they are not constants since they are quoted. They're just string values.