Creating Back Button
Posted: Wed Oct 04, 2023 2:49 am
Hi,
I am creating a Minimum order type function on my site....
I am currently reworking the tpl_cm_sc_checkout.php file with an;
if minimum order reached -> show checkout button
else -> show continue shopping button
so I am just using the same "Button" as the original button but was thinking that the best option was to go back to the previous page (IE before they went to checkout)...
so this is my code...
essentially the same as the original...
2 questions;
1. what would I change $GLOBALS['Linker']->build('checkout_shipping.php') to to make it go back? - I've tried a few things with no luck.
2. is there a better class (or whatever) to use than "btn-success"? Is there a generally recognised convention that I should stick to and if so how do I find out what that would be?
I am creating a Minimum order type function on my site....
I am currently reworking the tpl_cm_sc_checkout.php file with an;
if minimum order reached -> show checkout button
else -> show continue shopping button
so I am just using the same "Button" as the original button but was thinking that the best option was to go back to the previous page (IE before they went to checkout)...
so this is my code...
Code: Select all
<?= new Button(MODULE_CONTENT_SC_MIN_ORDER_CHECKOUT_BUTTON_CONTINUE_SHOPPING, 'fas fa-angle-right', 'btn-success btn-lg btn-block', [], $GLOBALS['Linker']->build('checkout_shipping.php')) ?>essentially the same as the original...
2 questions;
1. what would I change $GLOBALS['Linker']->build('checkout_shipping.php') to to make it go back? - I've tried a few things with no luck.
2. is there a better class (or whatever) to use than "btn-success"? Is there a generally recognised convention that I should stick to and if so how do I find out what that would be?