VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: roman5527 on December 04, 2018, 17:31:19 PM

Title: Continue link
Post by: roman5527 on December 04, 2018, 17:31:19 PM
Hi, how i can change continue link to category page where is the ordered product? so that the user continues to view the products where they stopped?

thanks
Title: Re: Continue link
Post by: jenkinhill on December 04, 2018, 17:38:27 PM
Edit and override components/com_virtuemart/views/cart/tmpl/padded.php
Title: Re: Continue link
Post by: roman5527 on December 04, 2018, 17:58:14 PM
Thank you for your response. I know the need to change this file. I soon wonder what to change to make the customer return to the category where he ended because it now returns to the first site of the category. well thank you
Title: Re: Continue link
Post by: roman5527 on December 05, 2018, 09:54:41 AM
Example : in category I have 10 pages. i click to product in page 7 . i add product to the cart and when i click to continue button i want go back to page 7 in category , no first page.
can you any idea how change padded.php file for this solution ? thanks
Title: Re: Continue link
Post by: roman5527 on December 07, 2018, 11:43:08 AM
Hi, any idea ? thanks
Title: Re: Continue link
Post by: Ventsi Genchev on December 07, 2018, 11:46:18 AM
Change:
echo '<a class="continue_link" href="' . $this->continue_link . '" >' . vmText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';

With:
echo '<a class="continue_link" href="' . $this->close_facebox . '" >' . vmText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
Title: Re: Continue link
Post by: roman5527 on December 07, 2018, 11:58:09 AM
Hi, Ventsi Genchev . Thank you for your answer . But this code stay on product page .

I want go back to page in category , but no on first , but n page where is this product.

do you have any idea for this solution ? many thanks
Title: Re: Continue link
Post by: GJC Web Design on December 07, 2018, 12:53:28 PM
It is hard to do ..  if u are on a product page who knows what route u took to get there

fine .. we can know the cat but how would u know the pagination page?
Title: Re: Continue link
Post by: Ventsi Genchev on December 07, 2018, 13:00:46 PM
Quote from: roman5527 on December 07, 2018, 11:58:09 AM
Hi, Ventsi Genchev . Thank you for your answer . But this code stay on product page .

I want go back to page in category , but no on first , but n page where is this product.

do you have any idea for this solution ? many thanks

The code I showed you closes the window and stays on the same page.
To go back to the category on the same page, you have a "Back to: category name" button. Or the "back" button in the browser.

Why do you think the user does not want to stay on the same page? What if he wants to see something else in the product?
No, he has to leave because there is no more work on this page?
Title: Re: Continue link
Post by: roman5527 on December 07, 2018, 14:20:13 PM
Hi, my client want this solution.

back to category link is link to first page in category but I want page where is product .

example : product is in category page on 5 page . after click to continue link i want go back to 5 page in category.

do you have any idea for this solution ? tahnks
Title: Re: Continue link
Post by: GJC Web Design on December 07, 2018, 15:53:10 PM
as explained... how?

pagination is a dynamic thing that can vary on every load! .. filtering, ordering etc..
and how do u know the user came from product x page 5??

It is a fairly nonsensical request from your client...  you should enlighten them
Title: Re: Continue link
Post by: jenkinhill on December 07, 2018, 16:42:34 PM
If you want to see how VM will always go back to the first page of a category because a simple return is not possible,  just try selecting the product details of a product on (for example) page 3. From the product details page click on the return to category link - and see where you end up.
Title: Re: Continue link
Post by: Jörgen on December 08, 2018, 00:36:45 AM
I do not get it, clicking back button in browser takes me back to the page I was before. This should be easy to do, I think. Have not tried, but this could work:
<button onclick="goBack()">Go Back</button>

<script>
function goBack() {
    window.history.back();
}
</script>


Jörgen @ Kreativ Fotografi
Title: Re: Continue link
Post by: GJC Web Design on December 08, 2018, 11:08:10 AM
No Jörgen,

what he means is that if he is on the prod detail page having come from anywhere or even from e.g. shoes - page 5 of a paginated category he wants the continue button to go back paginated page 5 shoes.
If he came from there then a JS return will work but in all other circumstances I assume u will land on PAGE 1 of shoes

The paginated pages are set in stone, they vary all the time depending on filters, orders, direction, products per page etc so is simply not possible without a complex query to find the product and what page it would appear on taking into account all the above variables
Title: Re: Continue link
Post by: jenkinhill on December 08, 2018, 16:54:30 PM
Jörgen I just tried using that JS in padded.php on one of my development sites using Spyros' Hera template and it did return the shopper to the correct category page with the correct product on it. I can see that it probably wont work in all cases but maybe is the simplest "solution". 
Title: Re: Continue link
Post by: Jörgen on December 08, 2018, 18:42:40 PM
Hello Kelvyn,

I am also using the Hera template. Nice to see that this could be a possibility :)

Jörgen @ Kreativ Fotografi
Title: Re: Continue link
Post by: roman5527 on December 10, 2018, 10:21:43 AM
Hi, can anyone please solve some data from Hera template?

thanks