Change 'Shipping' to 'Delivery' in Simple Cart Order Summary

3 posts by 2 authors in: Forums > CMS Builder
Last Post: 16 hours ago   (RSS)

Where is 'name' set in the code below?

Can it be easily changed without screwing-up anything else? Thanks!

<?php if ($extraLineItems): ?>
<?php foreach ($extraLineItems as $extraLineField => $extraLineItem): ?>
<div class="row">
<div class="col-6">
<p class="mb-0"><?php echo htmlencode($extraLineItem['name']); ?></p>
</div>
<div class="col-6">
<p class="text-end mb-0"><?php echo sc_moneyFormat($extraLineItem['TOTAL']); ?></p>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
Jeff

Thanks for your help Dave.

Thanks for pointing me in the right direction. I found a different solution. In customCart.php

function sc_addShipping($cartItems) {
	$shippingTotal = 0;
	foreach ($cartItems as $cartItem) {
		$shippingTotal += @$cartItem['shipping'] * @$cartItem['quantity'];
		foreach ($cartItem['OPTIONS'] as $option) {
			$shippingTotal += @$option['shipping'] * @$cartItem['quantity'];
		}
	}
	return array( 'name' => 'Shipping', 'TOTAL' => $shippingTotal );
}

Changed:

return array( 'name' => 'Shipping', 'TOTAL' => $shippingTotal );

to

return array( 'name' => 'Delivery', 'TOTAL' => $shippingTotal );

Using the same method I changed TAX to VAT.

function sc_addTax($cartItems) {…

return array( 'name' => "VAT ($taxPercentage%)", 'TOTAL' => $taxTotal );

…}

Jeff