Cart customization

Hi Rod. Thx for your support the last days!
In the old CE 4 universe I did some additional information during checkout process via php. See screenshot marked in red.

using this php snippet

function ttg_block_top( $style, $path){
if (G_STYLE == ‘CE4-CART’) {
echo’

Important note for print orders:

For the time being only national delivery (within Germany) is offered as shipping option in the webstore. In case of needed international delivery please contact as a first step Videografic to clarify both corresponding pricing and further process of placing the order.


';
return true; //places text at the top of the block in the cart
}
return true; //keeps content of other page blocks in place
}

Could you please advise how this has to look like now in BL in phplugins-pangolin-sample.php file?

Backlight Cart is not accessible via phplugins like that. I added some text to my cart checkout using jQuery via the phplugins script hook.
My solution checks to see if something unique to the cart html is there, in this case, the “Skip to Checkout” link. Then it inserts the instructions beneath the Total and above the buttons.
Here’s what it looks like

and here’s the code I added to the phplugins script hook:

<script>
	if ($("p.skip-to-checkout").length) {	
	$("<p class=\'instructions\' style=\"font-size:larger;\"><strong>Instructions: </strong>If paying by check, click on the <strong>\"Pay by Check\"</strong> button. Otherwise, click on the <strong>PayPal</strong> button.</p>").insertAfter($("p#checkout-total"));
	}
</script>

You may need to add some styling with custom css.
If you want your message to appear directly below the Skip to Checkout link, then use: “p.skip-to-checkout” rather than “p#checkout-total” in the .insertAfter method.

There are changes to phplugins since the CE4 days so don’t use any of your old code. Start with the phplugins-pangolin-sample.php file. You can access it via ftp at /backlight/modules/custom-resources/phlugins. This location is a recent change and isn’t reflected in the documents.
Once you make your changes to the file, upload it to /backlight/custom/phplugins/.

Thx, I will have a closer look at this in the next days. Only to be sure: in which file did you copy the code you posted?

It goes in the phplugins file using the scripts hook. Here’s the function:

function scripts() { 
	
echo '
<script>
	if ($("p.skip-to-checkout").length) {	
	$("<p class=\'instructions\' style=\"font-size:larger;\"><strong>Instructions: </strong>If paying by check, click on the <strong>\"Pay by Check\"</strong> button. Otherwise, click on the <strong>PayPal</strong> button.</p>").insertAfter($("p#checkout-total"));
	}
</script>
';
}

Perfect, Thx