Where is $order->product created?

Open to all! Ask other shopowners for help.
Post Reply
User avatar
bonbec
Contributor
Posts: 190
Joined: Mon Oct 26, 2020 12:23 pm
Phoenix Version: V1.1.0.7
Has thanked: 54 times
Been thanked: 40 times

Where is $order->product created?

Post by bonbec »

For a shipping module, the dimensions of a product (length, width and height) must be used to determine the cardboard box for shipping.
I created the products_length, products_width and products_height fields in the products table.
I found that you can use $order->products in the shipping module, this gets information from the products table, but it doesn't give me products_length, products_width and products_height.
I can't seem to find in the files how and where this information is found. I think that would be what I need to move forward.
Unless there is another way that I haven't thought of...
Thanks in advance.
Old MS2.2 PHP7.4 site being converted to CE Phoenix v1.1.0.6 PHP 8.3


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Where is $order->product created?

Post by ecartz »

https://github.com/CE-PhoenixCart/Phoen ... er.php#L33

That is the line with the hook to add columns to be copied from the cart to the order.

Code: Select all

class hook_shop_siteWide_dimensions {

  public function listen_cartOrderProductColumns($parameters) {
    $parameters['column_keys']['length'] = 'length';
    $parameters['column_keys']['width'] = 'width';
    $parameters['column_keys']['height'] = 'height';
  }

}
User avatar
bonbec
Contributor
Posts: 190
Joined: Mon Oct 26, 2020 12:23 pm
Phoenix Version: V1.1.0.7
Has thanked: 54 times
Been thanked: 40 times

Re: Where is $order->product created?

Post by bonbec »

Thank you very much :D
Old MS2.2 PHP7.4 site being converted to CE Phoenix v1.1.0.6 PHP 8.3


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply