Post by suportequalidadeweb » Thu Jan 26, 2017 9:49 pm

Order of change of "accordion" in cart

The order is:

1 - Use Coupon Code
2 - Shipping
3 - Use Gift Voucher

I want to change to:

1 - Shipping
2 - Use Coupon Code
3 - Use Gift Voucher


Posts

Joined
Fri Dec 09, 2016 7:58 pm

Post by thekrotek » Thu Jan 26, 2017 10:15 pm

Have you tried to define sort order for these modules? They all are on Extension -> Order Totals page.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by suportequalidadeweb » Thu Jan 26, 2017 10:36 pm

thekrotek wrote:Have you tried to define sort order for these modules? They all are on Extension -> Order Totals page.
Yes, even changing the order I want there, the order is not changed in the frontend.


Posts

Joined
Fri Dec 09, 2016 7:58 pm

Post by thekrotek » Fri Jan 27, 2017 2:02 am

Well, the code for this part is simple: it takes everything from catalog/extension/total folder and simply creates an array. So they're ordered alphabetically by default: coupon, shipping, voucher. You need to add some kind of sorting for $data['modules'] variable in catalog/controller/checkout/cart.php file. The best way is to set desired sort order in admin and sort the modules array by 'sort_order' index.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by drestis » Sat Oct 20, 2018 5:10 am

<!---- CHANGE ORDER OF ACCORDION IN CART --->
works like a charm to me OC2.3

Look for this...
in \catalog\view\theme\default\template\checkout\cart.tpl' file

replace ....

<?php if ($modules) { ?>
<h2><?php echo $text_next; ?></h2>
<p><?php echo $text_next_choice; ?></p>
<div class="panel-group" id="accordion">
<?php foreach ($modules as $module) { ?>
<?php echo $module; ?>
<?php } ?>
</div>
<?php } ?>

To this...

<?php if ($modules) { ?>
<h2><?php echo $text_next; ?></h2>
<p><?php echo $text_next_choice; ?></p>
<div class="panel-group" id="accordion">
<?php //foreach ($modules as $module) { ?>
<?php echo $modules[1]; //shipping ?>
<?php echo $modules[0]; //coupon?>
<?php echo $modules[2]; //voucher?>
<?php //} ?>
</div>

;D

<!--- No comments --->


Newbie

Posts

Joined
Sat Oct 20, 2018 5:08 am
Location - Greece
Who is online

Users browsing this forum: No registered users and 212 guests