Skip "thankyou for your order" for free products, and / or style message

  • Posts: 32
  • Thank you received: 1
4 years 2 weeks ago #325496

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.19
-- PHP version -- : 7.4

I have some free products on my site, and when I go through checkout with them I'm sent to the generic thankyou page. I understand that each payment plugin has a return url option, but how do I do this for free products? I would just like people to be sent directly to their order.

If it can't be done, can you tell me how to change the styling for the thankyou message? It just uses body text but I don't know what CSS to change to style just this message.

I also have the same issue with the PayPal plugin; I get bumped to a redirect page saying 'now sending you to paypal, or click this button' but I can't for the life of me figure out how to style that message in CSS.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 2 weeks ago #325504

Hi,

The thank you message is displayed by the file end.php of the view "checkout". You can edit it via the menu Display>Views.
There, you'll see this code:

echo JText::_('THANK_YOU_FOR_PURCHASE');
	if(!empty($this->url))
		echo '<br/>'.JText::sprintf('YOU_CAN_NOW_ACCESS_YOUR_ORDER_HERE', $this->url);
which displays the standard thank you message.
So you can edit the code there.
If you want to redirect the customer to the order page, then you could do a redirect on $this->url.
For example:
$app = JFactory::getApplication();
$app->redirect($this->url);
Regarding the CSS, you could directly add HTML tags with CSS inline or classes of your own in there as you need.

Regarding the PayPal redirection area, it's displayed by the file plugins/hikashoppayment/paypal/paypal_end.php^
If you look at that file, you can see this code:
	<span id="hikashop_paypal_end_message" class="hikashop_paypal_end_message">
		<?php echo JText::sprintf('PLEASE_WAIT_BEFORE_REDIRECTION_TO_X', $this->payment_name).'<br/><span id="hikashop_paypal_button_message">'. JText::_('CLICK_ON_BUTTON_IF_NOT_REDIRECTED').'</span>';?>
	</span>
So with CSS, you can just use the classes already available to customize the look.
For example, you could add such CSS to change the color of the text to red:
#hikashop_paypal_end_message{ color: red !important; }
www.hikashop.com/support/documentation/1...ize-the-display.html

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 1
4 years 1 week ago #325872

Hi Nicolas. Only just getting round to having a look at this.

Is there a way to view these pages without having to complete a transaction? I'd like to work on them without having to incur paypal fees!

All sorted now, thanks man.

Last edit: 4 years 1 week ago by jeffmcbiscuit.

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 1
3 years 11 months ago #327276

Hi Nicolas, sorry to necro this but I don't think I actually sorted this in the end. Regarding the redirect you suggested, where do I need to add that code? I know the page but I don't know where it goes in the code.

Just to confirm, my desire here is to skip the page with this message on completely and go from completing the purchase to the orders screen

Last edit: 3 years 11 months ago by jeffmcbiscuit.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 11 months ago #327293

Hi,

You could just replace the first piece of code I gave with the second piece of code I gave.

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 1
3 years 11 months ago #327321

Ah great, thanks man. I was sure I'd done that before but I must have reversed it somehow :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.067 seconds
Powered by Kunena Forum