Cart goes straight to checkout after adding item

  • Posts: 121
  • Thank you received: 7
12 years 2 months ago #62147

I've configured Hikashop to 'Always stay on same page' after adding an item to the cart. However, it doesn't seem to pay attention to that variable and just heads straight for checkout after adding an item to the cart. Is this a bug or am I misconfiguring something?

You can see the behaviour yourself at beta.nucleus-soundlab.com

Last edit: 12 years 2 months ago by jeremynsl.

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

  • Posts: 13201
  • Thank you received: 2322
12 years 2 months ago #62189

Hi jeremynsl,

It has been corrected and will be in the next release of HikaShop.
Thanks to wait for it, the release is going to be available tomorrow.

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

  • Posts: 121
  • Thank you received: 7
12 years 2 months ago #62686

Hi Xavier,

Thanks for the nice update. However, this problem has not been fixed. I've just updated HikaShop from the Joomla update component and still the cart goes straight to checkout regardless of settings.

None of the settings work - 'stay and display a popup notice' doesn't do anything either, just goes straight to checkout.

You can check out the behaviour on my site beta.nucleus-soundlab.com

My cart is set to 'always stay on the same page'

Jeremy

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

  • Posts: 13201
  • Thank you received: 2322
12 years 2 months ago #62751

Hi jeremynsl,

Can you give me a screenshot of your checkout configuration ?

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

  • Posts: 121
  • Thank you received: 7
12 years 2 months ago #62894

Sure. Its attached.

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
12 years 2 months ago #62948

Hi jeremynsl,

I tried your configuration on my end, and it's working fine.
Can I ask you to install again the last HikaShop version from our website. The last package has been uploaded this morning.

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

  • Posts: 121
  • Thank you received: 7
12 years 2 months ago #63074

Hi,

I've upgraded to Essential from the Starter version today, and downloaded the latest version. I'm afraid there is still no change. The cart does not pay attention to the "After a product is added to the cart" variable.

Would you like me to create a login for you on my site?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 2 months ago #63159

Hi,

I checked your website and you're using the "add to cart html button" code which allows you to add add to cart buttons anywhere. However, these buttons do not support the "After a product is added to the cart" option of the configuration.

If you want to have that option taken into account for your add to cart buttons, you should instead use the add to cart buttons that you can add thanks to the "product tag" plugins that we developed for the latest release of HikaShop. The downside is that you won't get the custom text on the button like you have now.
In order to do that, you first have to publish the plugins "HikaShop Product TAG insertion" and "HikaShop Product TAG translation".
Then you will be able to simply add such code in your content:
{product}XXX|cart{/product}

where XXX is the id of the product and it will transform it into a normal HikaShop add to cart button.

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

  • Posts: 121
  • Thank you received: 7
12 years 2 months ago #63166

Hi Nicolas,

Thanks for figuring that out. But it kinda sucks for me because I've already completed my entire site based on the HTML addtocart links! I'll lose my styling (which looks great doesn't it?) and I'll have to retool every product page to fix this.

Isn't it a bug that this does not work with the add to cart link buttons? Because they are nearly useless otherwise IMO. Could it be possible to fix the buttons? I've just purchased HikaShop and this is a big disappointment for me...

Jeremy

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 2 months ago #63384

Hi,

The buttons are indeed great like you have them.

It's not a bug. The HTML buttons don't have any javascript so that they can be used anywhere.
You can have them on other websites, in emails, facebook, whatever.
Because of that, they don't handle the advanced things like the quantity input box, the popup notice, the quantity limitation warnings, etc.
On the other end, the advanced add to cart buttons that you can create with these new plugins can only be added on your website.

The only way to "fix" the buttons would be to have them use the same javascript as the advanced add to cart buttons that you can have with the plugins. And doing that via the HTML editor of your articles is not possible and even if it was, it would still require that you edit each article.

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

  • Posts: 121
  • Thank you received: 7
12 years 2 months ago #63575

Hi Nicolas,

I guess I misunderstood how the HTML buttons worked. My mistake. It would be great if they had the option to contain the javascript...

But anyway, it sounds like I need to update every page regardless. Ok. But can you help me get the styling the same? If you look at this page:
beta.nucleus-soundlab.com/index.php?opti...pellerhead-reason-5+

I have the tag cart inserted first, followed by my custom button. I'd like the tag cart to look the same - so I don't want it centered, don't want the item name and I want to be able to add the css class "icon-shopping-cart" to it so that my shopping cart icon shows up. Even better if I could add the price to the button like I've got!

I checked the tag plugins and they have no options. I think this should be possible by editing the php and css - so if you could give me a starting point for getting that done it would be super helpful. Thanks,

Jeremy

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 2 months ago #63805

Hi,

You will have to copy the file plugins/system/hikashopproductinsert/hikashopproductinsert_view.php to templates/YOUR_TEMPLATE/system/hikashopproductinsert_view.php
Then, you can edit the file templates/YOUR_TEMPLATE/system/hikashopproductinsert_view.php and do your modifications there.

To have the button on the left, you can add that CSS on your website:
.hikashop_inserted_product .hikashop_product_stock {
text-align: left;
}

You won't be able to add the class you want but instead, you should change your CSS to use the class of the button: hikashop_cart_input_button

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

  • Posts: 121
  • Thank you received: 7
12 years 2 months ago #64442

Hi Nicolas,

Thank you for your help. I was able to remove the title over the button as well as align it on the left side. However I still am having trouble with adding the css icon class. Can you describe this more?

"You won't be able to add the class you want but instead, you should change your CSS to use the class of the button: hikashop_cart_input_button"

I'm a css beginner, sorry.

Also - would it be possible to modify the php so that the Hikashop product price is displayed after the 'Add to Cart' text string in the button?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 2 months ago #64613

What I'm saying is this:
You can't add the class icon-shopping-cart to the button.
But the CSS class icon-shopping-cart is defined somewhere right ?
Probably in a CSS file of your template.
So you can just change its name to hikashop_cart_input_button there and that will do the job.

In the hikashopproductinsert_view.php file, you can see the different blocks of code to display each element. Just swap them in order to display them in a different order. for example, the price display block is delimited by the code <!-- PRODUCT PRICE --> and <!-- EO PRODUCT PRICE -->

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

  • Posts: 121
  • Thank you received: 7
12 years 2 months ago #65344

Hi Nicolas,

That isn't what I am looking for, I think maybe you misunderstood. I want my button to say 'Add to Cart $xx' with the price filled in by the appropriate Hikashop product price.

I think I perhaps need to edit this part of the hikashopproductinsert_view.php:

if($this->cart == 1 && $product->product_quantity!=0){
				$params->set('price_with_tax',$config->get('price_with_tax',1));
				$params->set('add_to_cart',1);
				$add_to_cart = hikashop_getLayout('product', 'add_to_cart_listing',$params,$js);
				echo $add_to_cart;

But I'm not sure how to modify the variable $add_to_cart to get it to also display the product price.

nicolas wrote: In the hikashopproductinsert_view.php file, you can see the different blocks of code to display each element. Just swap them in order to display them in a different order. for example, the price display block is delimited by the code <!-- PRODUCT PRICE --> and <!-- EO PRODUCT PRICE -->

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 2 months ago #65527

Indeed, I thought that you just wanted to move the elements around.

You can replace :
echo $add_to_cart;

by:
echo str_replace('Add to cart $','Add to cart $'.$product->prices[0]->price_value,$add_to_cart);

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

  • Posts: 121
  • Thank you received: 7
12 years 2 months ago #66511

Hi Nicolas,

Thanks but I just tried that and no change. Here is what the code looks like (this in my templates /system folder). It still says 'Add To Cart' in the button with nothing appended at the end.

You can see it here:
beta.nucleus-soundlab.com/products/refil...erhead-reason-5.html

<span class="hikashop_add_to_cart icon-shopping-cart">
			<?php
			if($this->cart == 1 && $product->product_quantity!=0){
				$params->set('price_with_tax',$config->get('price_with_tax',1));
				$params->set('add_to_cart',1);
				$add_to_cart = hikashop_getLayout('product', 'add_to_cart_listing',$params,$js);
				echo str_replace('Add to cart $','Add to cart $'.$product->prices[0]->price_value,

$add_to_cart);
				
			}
			?>
			</span>
			<!-- EO ADD TO CART BUTTON AREA -->

nicolas wrote: Indeed, I thought that you just wanted to move the elements around.

You can replace :
echo $add_to_cart;

by:
echo str_replace('Add to cart $','Add to cart $'.$product->prices[0]->price_value,$add_to_cart);

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 2 months ago #66640

The name of your button is "Add to cart". So you should use that in the code...
Like that:

echo str_replace('Add to cart','Add to cart $'.$product->prices[0]->price_value,$add_to_cart);

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

  • Posts: 121
  • Thank you received: 7
12 years 2 months ago #66692

Hi Nicolas,

Thanks for all your help with this - I really appreciate it. That code did work. One issue though. It produces a price with 5 decimal places? Have a look:
beta.nucleus-soundlab.com/products/refil...erhead-reason-5.html

Can I modify that so only two decimal places are used?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 2 months ago #66696

sure, you can change :
$product->prices[0]->price_value

to:
round($product->prices[0]->price_value,2)

in that code.

The following user(s) said Thank You: jeremynsl

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

Time to create page: 0.098 seconds
Powered by Kunena Forum