advise during the ceckout

  • Posts: 719
  • Thank you received: 3
11 years 3 months ago #119397

-- url of the page with the problem -- : mywebsite.com/mypage
-- HikaShop version -- : 2.2.0
-- Joomla version -- : x.x
-- PHP version -- : x.x.x
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message

Hi,
is it possible to insert something like a popup or an advise during the workflow ceckout?


my site with Hikashop
www.lacasettabio.it

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
11 years 3 months ago #119401

Sure. You can edit the fie "step" of the view "checkout" via the menu Display>Views and add the text you want at the beginning to have it displayed at the top of your checkout.

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

  • Posts: 719
  • Thank you received: 3
11 years 3 months ago #119481

Hi,
i put it on top of the code and it works
but i have the same message on all the page/step of the checkout.
Is there a way to have it just one time on one step?


my site with Hikashop
www.lacasettabio.it

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

  • Posts: 12953
  • Thank you received: 1778
11 years 3 months ago #119498

Hi,

Sure you'll just have to add a condition like this :

if($this->step==YOUR_STEP){ 
DO WHAT YOU WANT TO DO HERE
}
Where YOUR_STEP is the step where you want your code to run.

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

  • Posts: 719
  • Thank you received: 3
11 years 3 months ago #119570

Hi,
how can i have the name of the step (YOUR_STEP)? I'd like the address step.


my site with Hikashop
www.lacasettabio.it
Last edit: 11 years 3 months ago by lacasetta.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
11 years 3 months ago #119574

It's the number of the step (it starts at 0). If the address step is the second one, you can use the number 1.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 3 months ago #119579

The first checkout step is the step number 0, so if your code to run through the 3rd step for example, the "YOUR_STEP" variable will be equals to 2.

---EDIT---
Don't saw the previous post... :).

Last edit: 11 years 3 months ago by Mohamed Thelji.

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

  • Posts: 719
  • Thank you received: 3
11 years 3 months ago #119622

Thanks a lot!
Your support is Always the best!
Please, keep it up! ;)


my site with Hikashop
www.lacasettabio.it

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

  • Posts: 719
  • Thank you received: 3
8 years 10 months ago #225495

Hi,
i'd like to add a class on this message so i've thought to create a class into a div:

<div class="alert alert-message">
	<?php
	if($this->step==0){ 
	echo JText::_('WARNING_CHECKOUT_STEP_ZERO');
	} 
?></div>
This way works but i have the div empty when the step is not =0.
Is there a way to have a class without the div or something else to have the class in the text?
Thanks a lot if you'd like to help me
Best regards


my site with Hikashop
www.lacasettabio.it
Last edit: 8 years 10 months ago by lacasetta.

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

  • Posts: 12953
  • Thank you received: 1778
8 years 10 months ago #225506

Hello,
Then using that kind of code will probably do the job :

<?php
if($this->step==0)
     echo '<div class="alert alert-message">' . JText::_('WARNING_CHECKOUT_STEP_ZERO') . '</div>';
?>

Last edit: 8 years 10 months ago by Mohamed Thelji.
The following user(s) said Thank You: lacasetta

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

  • Posts: 719
  • Thank you received: 3
8 years 10 months ago #225589

Yes, perfect!
Thanks a lot!
Best regards


my site with Hikashop
www.lacasettabio.it

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

  • Posts: 719
  • Thank you received: 3
8 years 1 month ago #253556

Hi,
i need to improve this code with the condition of the total price of the order.
So i've just modified the code like that

<?php
	$min=15;
	$tot=$this->total->prices[0]->price_value_with_tax;
	if($tot<$min){
	if($this->step==0){ 
	echo '<div class="alert alert-message">' . JText::_('WARNING_CHECKOUT_STEP_ZERO') . '</div>';
	}} else {
	echo '<div class="alert alert-message">' . JText::_('WARNING_CHECKOUT_STEP_ZERO_FREE') . '</div>';
	}
	?>
It works fine but only on the first step that is step 0.
I need a warning message on the step = 3 also but it does not work fine.
The issue is that after the step=0 the variable $tot, get with
$tot=$this->total->prices[0]->price_value_with_tax;
,
is empty.
Could you help me to have a total price in the variable $tot on the other steps also?
Thanks a lot for your help
My best regards


my site with Hikashop
www.lacasettabio.it
Last edit: 8 years 1 month ago by lacasetta.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 1 month ago #253560

Hi,

That's because $this->total is only available when the cart view is on the current step.
You need to load yourself the cart total like that:

if(empty($this->total)){
$cartClass = hikashop_get('class.cart');
$cart = $cartClass->loadFullCart();
$this->total =& $cart->full_total;
}

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

  • Posts: 719
  • Thank you received: 3
8 years 1 month ago #253663

Hi,
indeed, on the step=0 there is the chart but the chart there is not on the other steps.
So, now, it is bette rwith your code to load the cart .
But, I'm sorry, excuse me, i need some more help.
Your code loads the total with the shipping cost. I need to load the total without the shipping cost.
Could you help me again, please?
Thanks a lot
Best regards


my site with Hikashop
www.lacasettabio.it
Last edit: 8 years 1 month ago by lacasetta.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 4 weeks ago #253672

Hi,

Then try it like that:
$this->total =& $cart->total;

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

  • Posts: 719
  • Thank you received: 3
8 years 4 weeks ago #253779

Yes, perfect!
Thank you a lot!
My best regards


my site with Hikashop
www.lacasettabio.it

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

  • Posts: 719
  • Thank you received: 3
8 years 4 weeks ago #253782

I post my code just like a reminder for me or for helping someone else

<?php
	if(empty($this->total)){
	$cartClass = hikashop_get('class.cart');
	$cart = $cartClass->loadFullCart();
	$this->total =& $cart->total;
	}
	$min=15;
	$tot=$this->total->prices[0]->price_value_with_tax;
	if($tot<$min){
	if($this->step==0){ 
	echo '<div class="alert alert-message">' . JText::_('WARNING_CHECKOUT_STEP_ZERO') . '</div>';
	}}
	if($tot>=$min){
	if($this->step==3){ 
	echo '<div class="alert alert-message">' . JText::_('WARNING_CHECKOUT_STEP_THREE') . '</div>';
	}}
	if($tot>=$min){
	if($this->step==0){ 
	echo '<div class="alert alert-message">' . JText::_('WARNING_CHECKOUT_STEP_ZERO_FREE') . '</div>';
	}}
	?>


my site with Hikashop
www.lacasettabio.it

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

Time to create page: 0.094 seconds
Powered by Kunena Forum