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...
1) See that PV listed on the "View Cart" page
2) See the "Total PV" for all items ordered
3) Record the per item PV into the "orders_products" table
4) Record the "Total PV" in the "orders" table.
What I have done to date (successfully)...
1) Added the field "products_point_value" to the "products" table
2) Added the ability to add/edit the value per product in my back office
3) Show the product PV on the shop product listing and detail pages (only if the user is logged in)
Where I am at now...
1) 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
Code:
<th scope="col" id="scUnitPointValue"><?php echo TABLE_HEADING_POINT_VALUE; ?></th>
2) Added table column to display the PV on the "view cart" page (includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php)
Code:
<td class="cartUnitDisplay"><?php if ( $detect->isMobile() && !$detect->isTablet() || $_SESSION['layoutType'] == 'mobile' or $detect->isTablet() || $_SESSION['layoutType'] == 'tablet' ) {echo '<b class="hide">' . TABLE_HEADING_POINT_VALUE . ': </b>'; } ?><?php echo $product['productsPointValue']; ?></td>
3) Added
Code:
$productsPointValue = $products[$i]['products_point_value'];
under
Code:
$productsPriceTotal = $currencies->format($ppt) ...
to the file (includes/modules/pages/shopping_cart/header_php.php) around line 152
4) Added
Code:
'productsPointValue'=>$productsPointValue,
to the "productArray" above "productsPrice" in the file (includes/modules/pages/shopping_cart/header_php.php) around line 170
5) Added the field "order_total_point_value" to the table "orders"
6) Added the field "products_point_value" to the table "orders_products"
What I don't know...
1) 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
2) I believe #3 & 4 (above) will add the PV to the session cart array once the select statement is updated. Or am I incorrect?
3) 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
Bookmarks