News:

Support the VirtueMart project and become a member

Main Menu

how to override view.html.php file?

Started by rage76, February 15, 2014, 09:49:07 AM

Previous topic - Next topic

rage76

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

jenkinhill

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
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

rage76

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

Jazajay

#3
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

rage76

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

Jazajay

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

StefanSTS

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
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

Jazajay

I have to admit I prefer stefen's solution to mine as it will save u time asking :)

rage76

Thanks Stefan & Jazajay

Will try and see how it goes !!

rage76

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?

AH

Regards
A

Joomla 3.10.11
php 8.0

rage76

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?

Jazajay

I would say it's not the right file you changed :)

StefanSTS

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?

--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

Milbo

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
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/