hi, I am looking for a way to override view.html.php so that the "continue shopping" link can be altered to take the customer to the site homepage. Is there a way to do this without a core hack?
This is URGENT. Please help !!
VM ver 2.0.24a
Joomla ver 2.5.18
What has view.html.php to do with it? Did you not try a forum search? See http://forum.virtuemart.net/index.php?topic=122048
Sir,
I did read our post. You said, It is in /components/com_virtuemart/views/cart/tmpl/default.php and is obviously labelled.
I found the below code in the file:
// Continue Shopping Button
if (!empty($this->continue_link_html)) {
echo $this->continue_link_html;
Are you suggesting:
echo $this->index.php ?
or should it be
echo index.php ?
------------------------------
On the other hand I found that "continue shopping" link on the checkout page was coming from view.html.php file !!
Please correct me and guide me.
regards
Hi Rage76
In your templates folder create a html folder.
In their create another folder called [your components name you want to override]
Then in the component you want to override find the view folder and create that within the templates > html > [your components name you want to override] folder.
So lets say you want to override a Virtuemart View in this case called padded.php, create the following:
templates/[template name]/html/[component name]/cart/padded.php
Now go to: components/com_virtuemart/views/cart/padded.php and copy this file to: templates/[template name]/html/[component name]/cart/padded.php
Now: templates/[template name]/html/com_virtuemart/cart/padded.php, will override: components/com_virteumart/views/cart/padded.php, regardless of a Virtuemart update (ie: you won't lose your changes on an update of virtuemart / nor will any updates get patched / loaded either).
Now in their change: echo '<a class="continue" href="' . $this->continue_link . '" >' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>'; to:
echo '<a class="continue" href="[home page URL]" >' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
Jaz
hi Jazajay
Thanks, but I have already done what you are suggesting. by doing this, "continue shopping" link on the facebox has changed, however, other similar links have not. I especially need to change the one which is shown on checkout page. After some research, I found that it is coming from view.html.php file.
Any ideas / suggestions are welcome !!
best wishes
Hi Rage76
That is a seperate link.
You can find that here:
<div class="width50 floatleft right">
<?php // Continue Shopping Button
if (!empty($this->continue_link_html)) {
echo $this->continue_link_html;
} ?>
</div>
File: com_virtuemart/views/cart/tmpl/default.php
Line: 94
Hi,
if you make a full text search over the virtuemart folders, you find the variable, that holds the link.
$continue_link = JRoute::_ ('index.php?option=com_virtuemart&view=category' . $categoryLink, FALSE);
Just use a text search tool like in Total Commander and find the files with $continue_link and change them according to your needs.
Found 5 files by the way.
So long
Stefan
I have to admit I prefer stefen's solution to mine as it will save u time asking :)
Thanks Stefan & Jazajay
Will try and see how it goes !!
I too found 5 files with the said link.
Now the question is how do I override these files?
anyone done this? or do I have to do a core hack?
Core hack
Ok, I found and changed this link:
$continue_link = JRoute::_ ('index.php?option=com_virtuemart&view=category' . $categoryLink, FALSE);
to
$continue_link = JRoute::_ ('index.php' . $categoryLink, FALSE);
but it is not working. did I do anything wrong?
I would say it's not the right file you changed :)
Quote from: rage76 on February 18, 2014, 06:30:07 AM
$continue_link = JRoute::_ ('index.php' . $categoryLink, FALSE);
but it is not working. did I do anything wrong?
Did you change that only in one file or in all 5 files?
You dont need todo a core hack. Just dont use the prepared value. Just ignore $continue_link and set your own link. use vmdebug('my this',$this); to see what you can use in your template
Dear Milbo
You will have to explain this in a better way. I am sorry but I didn't understand !!
He asked to override the continue link, not creat his own link :)
If he had asked to remove the link and create his own link then I would have suggested another option 8)
Why he wants to override the continue link? and not just directly use the one he creates anyway?
Quote from: rage76 on February 18, 2014, 06:30:07 AM
$continue_link = JRoute::_ ('index.php?option=com_virtuemart&view=category' . $categoryLink, FALSE);
to
$continue_link = JRoute::_ ('index.php' . $categoryLink, FALSE);
but it is not working. did I do anything wrong?
I just saw, that you are still appending the $categoryLink:
$continue_link = JRoute::_ ('index.php', FALSE);
might do the trick.
There is kind of a documentation for JRoute: http://docs.joomla.org/API17:JRoute, but I didn't really dig deaper to find out how JRoute really works and if you need it.
Well, this solution is kind of the fast lane, probably dirty in programmers eyes, but I am not a programmer. ;-)
So long
Stefan