VirtueMart Forum

VirtueMart 2 + 3 + 4 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: badvoicila on March 15, 2013, 19:18:49 PM

Title: redirect after post a review
Post by: badvoicila on March 15, 2013, 19:18:49 PM
Before      http://www.example.com/bratari/bratari-shamballa/bratara-shambala-cu-7-margele-detalii

post review

After         http://www.example.com/component/virtuemart/bratara-shambala-cu-7-margele-detalii

I have some modules .... disappear after post comments. because I do not see component/virtuemar in the menu.

some help??



help

component/virtuemart    - category/child category   ???
Title: Re: redirect after post a review
Post by: romatvirtue on July 05, 2013, 07:45:23 AM
Hi there. I am having the same issue. Were you able to figure this out?

Does anyone else know the answer?

Please help. I need to fix this for customer.

Thank you in advance.
Title: Re: redirect after post a review
Post by: romatvirtue on July 05, 2013, 07:54:02 AM
Quote from: Don LeeJust use the default joomla template, which is standard, to test. If the same issue happens with that template, we will know that it's a problem of VM, otherwise it is problem of Gavick template.

So I guess the problem is here:

<form method="post" action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$this->product->virtuemart_product_id.'&virtuemart_category_id='.$this->product->virtuemart_category_id) ; ?>" name="reviewForm" id="reviewform">

I just don't know how to let it stay on the same page.
Title: Re: redirect after post a review
Post by: phihong89 on July 05, 2013, 11:46:21 AM
has anyone solved this problem yet?
I also encountered similar cases.
my way is to create a menu of products.
one or more other ways not
Title: Re: redirect after post a review
Post by: romatvirtue on July 05, 2013, 17:18:17 PM
Quote from: phihong89 on July 05, 2013, 11:46:21 AM
has anyone solved this problem yet?
I also encountered similar cases.
my way is to create a menu of products.
one or more other ways not

Hey. What do you mean by
Quotemy way is to create a menu of products.
one or more other ways not
?
Title: Re: redirect after post a review
Post by: phihong89 on July 06, 2013, 06:49:47 AM
 ;) You crate menu each product in com virtuemart type product details.
Title: Re: redirect after post a review
Post by: phihong89 on July 06, 2013, 06:54:10 AM
Hack components virtuemart -> controller -> file productdetails.php
function review()
replace

$this->setRedirect (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . (int)$data['virtuemart_product_id']), $msg);

with

$this->setRedirect (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . (int)$data['virtuemart_product_id'].'&virtuemart_category_id=' .JRequest::getInt ('virtuemart_category_id')), $msg);
Title: Re: redirect after post a review
Post by: romatvirtue on July 06, 2013, 17:49:51 PM
Quote from: phihong89 on July 06, 2013, 06:54:10 AM
Hack components virtuemart -> controller -> file productdetails.php
function review()
replace

$this->setRedirect (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . (int)$data['virtuemart_product_id']), $msg);

with

$this->setRedirect (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . (int)$data['virtuemart_product_id'].'&virtuemart_category_id=' .JRequest::getInt ('virtuemart_category_id')), $msg);

So to answer your own questions, YOU did solve it! Your solution perfectly work. I didn't like creating the menu items for each product simply because it is a lot of work. But the code worked just fine. You saved my life. Thank you so much!!! :)

So this was a solution to VM 2.0.20b version. To me this was a bug and I am surprised no one from VM team responded.

Thanks again!
Title: Re: redirect after post a review
Post by: romatvirtue on July 07, 2013, 21:17:58 PM
Quote from: phihong89 on July 06, 2013, 06:54:10 AM
Hack components virtuemart -> controller -> file productdetails.php
function review()
replace

$this->setRedirect (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . (int)$data['virtuemart_product_id']), $msg);

with

$this->setRedirect (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . (int)$data['virtuemart_product_id'].'&virtuemart_category_id=' .JRequest::getInt ('virtuemart_category_id')), $msg);

Do you know how to create an override for this? I tried to use Joomla documentation on this, but could not get this to work.

Thank you in advance.