Continue Shopping button not working product optio

  • Posts: 165
  • Thank you received: 3
10 years 9 months ago #141616

-- url of the page with the problem -- : mywebsite.com/mypage
-- HikaShop version -- : 2.2.3
-- Joomla version -- :3.2.1
-- 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, I have my shopping cart set to "After a product is added to the cart" to "stay and display a popup notice"

However, it is not working it is going straight to the checkout and then displaying the popup instead. What is even weirder is it only appears to happen on products that have product options attached to them below:

209.59.173.183/mattresses/product/1-sleep-pedic-hotel-firm.html


If you add this product to the cart below with no product options it works fine and stays on the current product.

209.59.173.183/accessories/bases-foundat...ring-foundation.html

I have checked in the developer tools and there are no javascript errors that I can see what is wrong and how do I fix this?

Josh

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

  • Posts: 165
  • Thank you received: 3
10 years 9 months ago #141617

Hi, I think i found the problem but have no idea how to fix it. The Rsform form below if you submit it it takes you to the checkout for the the mattress instead of submitting the form how do I fix this. I have to get both to work.

209.59.173.183/mattresses/product/1-slee...west-price-guarantee


I see the problem the hikashop form below wraps around the rsform form causing the rsform submit button to submit the hikashop form
I have my rsform from in the product page layout and the below seems to wrap the entire product page.
<form action="/futons/product/updatecart.html" method="post" name="hikashop_product_form" enctype="multipart/form-data">
How do I fix this? It is basically causing nested forms which will not work. I need to unwrap the form tags from my bottom tabbed content.

Last edit: 10 years 9 months ago by jschroeder.

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

  • Posts: 165
  • Thank you received: 3
10 years 9 months ago #141729

Hi, I figured out where the problem is coming from. It is the show.php file. I removed the form tags <form action="<?php echo hikashop_completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form" enctype="multipart/form-data"></form>

Is there going to break anything on the site by doing this??

<?php
/**
* @package HikaShop for Joomla!
* @version 2.2.3
* @author hikashop.com
* @copyright (C) 2010-2013 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$canonical=false;
if(!empty($this->element->main->product_canonical)){
$canonical = $this->element->main->product_canonical;
}elseif(!empty($this->element->product_canonical)){
$canonical = $this->element->product_canonical;
}
if($canonical){
$doc = JFactory::getDocument();
$doc->addCustomTag( '<link rel="canonical" href="'.hikashop_cleanURL($canonical).'" />' );
}
?>

<div id="hikashop_product_<?php echo @$this->element->product_code; ?>_page" class="hikashop_product_page">
<?php
$app = JFactory::getApplication();
if (empty ($this->element)) {
$app->enqueueMessage(JText::_('PRODUCT_NOT_FOUND'));
} else {
if(!empty($this->links->previous))
echo "<a title='".JText :: _('PREVIOUS_PRODUCT')."' href='".$this->links->previous."'><span class='hikashop_previous_product'></span></a>";
if(!empty($this->links->next))
echo "<a title='".JText :: _('NEXT_PRODUCT')."' href='".$this->links->next."'><span class='hikashop_next_product'></span></a>";
echo "<div class='clear_both'></div>";
?>
<form action="<?php echo hikashop_completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form" enctype="multipart/form-data">
<?php
$this->variant_name ='';
if(!empty($this->element->variants)&&$this->config->get('variant_increase_perf',1)&&!empty($this->element->main)){
foreach (get_object_vars($this->element->main) as $name=>$value) {
if(!is_array($name)&&!is_object($name)){
if(empty($this->element->$name)){
if($name=='product_quantity' && $this->element->$name==0){
continue;
}
$this->element->$name=$this->element->main->$name;
continue;
}

}
if($this->params->get('characteristic_display')=='list' && !empty ($this->element->characteristics) && !empty($this->element->main->characteristics)){
$this->element->$name = $this->element->main->$name;
}

}
}
$this->setLayout($this->productlayout);
echo $this->loadTemplate();
?>
<?php if($this->productlayout != 'show_tabular'){ ?>
<input type="hidden" name="cart_type" id="type" value="cart"/>
<input type="hidden" name="add" value="1"/>
<input type="hidden" name="ctrl" value="product"/>
<input type="hidden" name="task" value="updatecart"/>
<input type="hidden" name="return_url" value="<?php echo urlencode(base64_encode(urldecode($this->redirect_url)));?>"/>
</form>

Last edit: 10 years 9 months ago by jschroeder.

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

  • Posts: 2334
  • Thank you received: 403
10 years 9 months ago #142327

Hi there,

I am pretty curious how this could have fixed your problem since this line is the one that allows to add product to cart.
If it worked on your end that's a good thing but there must be something wrong behind it (maybe the view loaded multiple times). Anyway, if you still have problems let us know.

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

  • Posts: 165
  • Thank you received: 3
10 years 9 months ago #142342

I have no clue that is why I was asking it seemed to have made no difference when I removed this. In fact when you view the source code it shows this link below and you can still add to cart. Like I said in my earlier post I just removed the form tags in the show.php in the section of code I pasted above which is the section that loads the product page layout. I removed the form tags from this section.


<form action=" 209.59.173.183/mattresses/product/1-sleep-pedic-hotel-firm.html " method="post" name="adminForm_hikashop_category_information_module_105_2_top">


I think in the future versions you should not wrap the description part of the page in form tags because that makes it impossible to add contact us forms in the product description. I know of a lot of sites that use that functionality as well. The way it is designed right now it loads the entire product page in form divs.

I know it is working on my site right now, but what is the correct way to fix this? Apparently just removing the form tags in the show.php view is not the correct way.

Thanks,

Josh

Last edit: 10 years 9 months ago by jschroeder.

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

  • Posts: 2334
  • Thank you received: 403
10 years 9 months ago #142513

Hi Josh,

Since you are the only one with this issue I would say that if it works then... keep it! The modification made on show.php through our view edition system won't be erased during an update so it's all good. We'll keep an eye on this though to make sure it's not a recurrent issue.

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

  • Posts: 165
  • Thank you received: 3
10 years 9 months ago #143578

Hi I thought this was working but this does not work by removing the form tags in the show.php whenever you try to add the product options or variants it will not add them to the cart only the main product.

I need a solution for this because I am getting ready to launch the site. What can I do to get this to work?

The entire product page cannot be wrapped in form divs because it causes nested form tags with my form on the page. I need the description part of the page not to be wrapped in the form divs.

Last edit: 10 years 9 months ago by jschroeder.

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

  • Posts: 2334
  • Thank you received: 403
10 years 9 months ago #143895

We just released a new version, try to download it on our site and tell me if you still have the issue (without your modification preferably).
If it's still there, give me a link to the site and I'll have a look at it.

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

  • Posts: 165
  • Thank you received: 3
10 years 9 months ago #143900

Hi, now I have another issue. I had modified the price to automatically be listed from lowest to highest price and now it is broken. How do I fix. I am sure a lot of other things may be broken as well.

Hi I forgot this invloved editing this file /components/com_hikashop/views/product/ view.html.php which is a core file. I went back and added the code again and it is fine.

Are there any plans in the future to give a option to filter price from lowest to highest?

Also, I removed my edit and the update did not fix the issue I am having with nested forms and it not adding the product options to the cart.

I did however come up with a solution though. I removed the form tags out where i previously mentioned in the show.php file and
Then in my show_default.php for my product page I added the forrm tags below around the "hikashop_product_right_part" of the show_default.php

<form action="<?php echo hikashop_completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form" enctype="multipart/form-data">
<input type="hidden" name="cart_type" id="type" value="cart"/>
<input type="hidden" name="add" value="1"/>
<input type="hidden" name="ctrl" value="product"/>
<input type="hidden" name="task" value="updatecart"/>
<input type="hidden" name="return_url" value="<?php echo urlencode(base64_encode(urldecode($this->redirect_url)));?>"/>
</form>

Thanks,

Josh

Last edit: 10 years 9 months ago by jschroeder.

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

  • Posts: 2334
  • Thank you received: 403
10 years 9 months ago #144624

Hi Josh,

Indeed core files are erased on update. But you can could simply use the "Ordering field" of the module/menu to order your products by price.
I'm still really surprised that deleting this form work for you. You might have some unclosed tags or something strange going on. anyway, if it works on your end, that's the alright!

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

Time to create page: 0.084 seconds
Powered by Kunena Forum