add to order global

Open to all! Ask other shopowners for help.
Post Reply
BatteryTrader
Contributor
Posts: 153
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Has thanked: 3 times
Been thanked: 17 times

add to order global

Post by BatteryTrader »

Hi

How can i add values to the actual order, eg

I use seo_title, and number_of (which is a line in my data base to show how many parts are included in that line, ie pack of 4)

I edited this in templates/ override/includes/modules/content/shopping_cart/tpl_cm_sc_product_listing.php, line number 27

Code: Select all

      // changed  to show seo title and number of --- echo '<a href="', $product->get('link'), '">', $product->get('seo_title'), '</a>';
               echo '<a href="', $product->get('link'), '">', $product->get('seo_title'), ' (pack of ' , $product->get('number_of'), ')', '</a>';
This gives me the info I would like to show to the customer on the whats in my cart page.

(now I understand what the templates override is, very cool)

But when I get to the order confirmation page, its referring back to products name, because its getting the data from the order and not the table

So I would like to be able to collect, in the order, products_desription seo-title and my new product_of, so I can show the same in product conf, maybe also available for Invoice and emails

So would like as I stated to add a few values to the order (global I assume its called) to use

Preferably in a way that does not affect the core, but I doubt if that is possible, at least minimise it.

Kindest regards

David

Tags:


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: add to order global

Post by ecartz »

BatteryTrader wrote: Sat May 10, 2025 9:23 am Preferably in a way that does not affect the core, but I doubt if that is possible, at least minimise it.
There are hooks to add characteristics to order products from the shopping cart products and to add characteristics to the shopping cart products from the database. You can do both without modifying core.

Set up products (for cart): https://github.com/CE-PhoenixCart/Phoen ... er.php#L17
Cart to order: https://github.com/CE-PhoenixCart/Phoen ... er.php#L33
Order to database: https://github.com/CE-PhoenixCart/Phoen ... r.php#L140
Database to order: https://github.com/CE-PhoenixCart/Phoen ... er.php#L47
BatteryTrader
Contributor
Posts: 153
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Has thanked: 3 times
Been thanked: 17 times

Re: add to order global

Post by BatteryTrader »

I would like to thank you ecartz, I would never of found that (https://github.com/CE-PhoenixCart/Phoen ... r.php#L140) the two added tables worked and details showing in order conf.

I will have to take them further down, invoice etc, but very good.

Only thing is I edited the core as I have not got my head around the hooks yet, but learning.

Regards

david


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