New Zenner
- Join Date:
- Jul 2016
- Location:
- Philippines
- Posts:
- 6
- Plugin Contributions:
- 0
Adding custom data to $SESSION['cart']
ZC Version: 1.5.5a
PHP version: 7.0
MySQL version: 5.5.54-cll
Template: responsive_classic
Plugins:
Tabbed Products Pro v1.20
Zen Colorbox
Additional Image Swapper
and
some self created shipping & payment modules specific to my locale
The end result I want to achieve:
Each product has an associated "Point Value" (PV). I want to...
- See that PV listed on the "View Cart" page
- See the "Total PV" for all items ordered
- Record the per item PV into the "orders_products" table
- Record the "Total PV" in the "orders" table.
What I have done to date (successfully)...
- Added the field "products_point_value" to the "products" table
- Added the ability to add/edit the value per product in my back office
- Show the product PV on the shop product listing and detail pages (only if the user is logged in)
Where I am at now...
- Added table column (with associated language definitions) to the "view cart" page (includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php) headings along with Qty, Item Name, Unit & Total ```
What I don't know...
- Where is the db query that gets the per product data to be added to the cart? I think I need to add "products_point_value" to that select statement in order to get it's value
- I believe #3 & 4 (above) will add the PV to the session cart array once the select statement is updated. Or am I incorrect?
- Then I need to figure out how to have the per product PV totaled and displayed.
I can't move forward to submitting the order (checkout process) until I can successfully have these "PV" values (per product and total) added to the cart array and displayed on the "view cart" page.
I hope someone can point me in the right direction.
Cheers,
John