Simple Cart Order Tweak

5 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: April 4, 2014   (RSS)

By Perchpole - April 4, 2014

Hello, All -

I've been making some good progress with simpleCart - which is doing pretty much everything I hoped. There are just a couple of things I'd like to tweak.

The first concerns the sc-order-summary.php page. It includes the following code:

<?php foreach ($extraLineItems as $extraLineItem): ?>
    <tr>
      <td><?php echo htmlspecialchars($extraLineItem['name']); ?>:&nbsp;</td>
      <td align="right"><?php echo sc_moneyFormat($extraLineItem['TOTAL']); ?></td>
    </tr>
<?php endforeach; ?>

In my set-up, the $extraLineItems are Tax and Shipping.

I would like to add a third column to the output to show details of how the TOTAL for VAT and Shipping have been calculated. The output would become:

<?php foreach ($extraLineItems as $extraLineItem): ?>
    <tr>
      <td><?php echo htmlspecialchars($extraLineItem['name']); ?>:&nbsp;</td>
      <td align="right"><?php echo sc_moneyFormat($extraLineItem['TOTAL']); ?></td>
      <td>My text and calculation</td>
    </tr>
<?php endforeach; ?>


How best should I go about this?

:0/

Perch

By Chris - April 4, 2014

Can you provide some specific and detailed examples of what should be displayed there and what calculations would be involved?

All the best,
Chris

By Perchpole - April 4, 2014

Hi, Chris -

It would be fairly basic stuff. It's more an exercise in learning how to insert the data in the loop than the data itself.

In the case of the shipping, for an example, I want to echo the value of the cart $weight to show the customer why they are being charged. In the case of Tax I want print a message for customers from the European Union because they would have to pay VAT.

:0)

Perch

By Perchpole - April 4, 2014

Stunning. Too good. You need to get out more!

Seriously, it's perfect. Thanks.

:0)

Perch