News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How to show the url at the product page when VM2 is used only as catalogue!

Started by pamchal, August 27, 2012, 11:49:36 AM

Previous topic - Next topic

pamchal

Hi!

I just started to work with Virtuemart 2 on Joomla 2.5. I don't need the shopping card feature so I check "Use only as catalogue". The problem is that I need to have the link I set in the  "product information" at the product detail page but when I check "Use only as catalogue" the link doesn't appear at the product detail page. I think I have to add some code to the theme but I don't know what code and where to put?

I'd be grateful if you help me to figure it out  :)

P. s. I was using VM1 on Joomla 1.5. In that case when I cheked "Use only as catalogue" the link was appeared but I wanted to show a small image instead of the link, so I asked here and some one told me to change some codes in the flypage of the VM theme and it worked! That's why I think there should be something to do with the theme again!

John2400

maybe download this editor set it in Joomla configuration and then use it in VM to set links as you like.
http://www.joomlacontenteditor.net/downloads/editor/joomla-25

pamchal

#2
Dear John,

Thank you so much for the attention but it seems I wasn't clear enough about my problem. I'm trying to show the problem in the pictures with "Use only as catalogue" checked and un-checked and how is the result on the product page. As you can see in the pictures, when "Use only as catalogue" is checked the link (www.virtuemart.net) isn't shown in the product page!

Waiting for help guys! :)

[attachment cleanup by admin]

pamchal

Hi again!
There was no answer, interesting!

I tried many different templates but non of them worked. In virtuemart 1.1.x, when the "use only as catalog" was checked, the whole shopping card would be disappeared and instead the "url" you defined in the product configuration would be shown. It seems such feature has not been considered in Virtuemart 2 which is really disappointing. I hope this will be covered in the next release.

Still any help is highly appreciated!! :(

ivus

Hi pamchal,

Perhaps a better way to explain it is to show us a screengrab of your VM1 products page that you're trying to replicate. I'm at a complete loss as to what you're trying to achieve?

Quotewhen "Use only as catalogue" is checked the link (www.virtuemart.net) isn't shown in the product page!
??? this makes no sense?

what really happens when "Use only as catalogue" is checked, is that you cannot add any products to the cart, meaning the cart functionality has been disabled.

John2400

Ok,

I had a little difficulty with this setting too but I went to an old site VM1 site and changed the configuration and added the URL link in the back- what I get is the price and the add to cart disappear - but when I click on the image when at the product level it jumps to a defined URL link; see here - click on the actual cake

http://www.cathscookie.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=47&category_id=9&option=com_virtuemart&Itemid=1

I'm sure Ivus will have an answer to add a URL so I'll leave it with you - for me I'd I'd just put it in the description. I'm not sure of the use of it.

jenkinhill

Quote from: pamchal on August 28, 2012, 01:24:13 AM

There was no answer, interesting!


pamchal, please remember that this is a forum, not a live chatroom.  You must allow for timezones, real paid jobs etc when awaiting a reply. http://forum.virtuemart.net/index.php?topic=104795.0
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

pamchal

#7
Quote from: jenkinhill on August 28, 2012, 10:15:32 AM
Quote from: pamchal on August 28, 2012, 01:24:13 AM

There was no answer, interesting!
Hi, thank you all for paying attention!


pamchal, please remember that this is a forum, not a live chatroom.  You must allow for timezones, real paid jobs etc when awaiting a reply. http://forum.virtuemart.net/index.php?topic=104795.0

Yes, you are completely right, my mistake! :)

Quote from: John2400 on August 28, 2012, 09:31:17 AM
Ok,

I had a little difficulty with this setting too but I went to an old site VM1 site and changed the configuration and added the URL link in the back- what I get is the price and the add to cart disappear - but when I click on the image when at the product level it jumps to a defined URL link; see here - click on the actual cake

http://www.cathscookie.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=47&category_id=9&option=com_virtuemart&Itemid=1

I'm sure Ivus will have an answer to add a URL so I'll leave it with you - for me I'd I'd just put it in the description. I'm not sure of the use of it.
Quote from: ivus on August 28, 2012, 01:56:59 AM
Hi pamchal,

Perhaps a better way to explain it is to show us a screengrab of your VM1 products page that you're trying to replicate. I'm at a complete loss as to what you're trying to achieve?

Quotewhen "Use only as catalogue" is checked the link (www.virtuemart.net) isn't shown in the product page!
??? this makes no sense?

what really happens when "Use only as catalogue" is checked, is that you cannot add any products to the cart, meaning the cart functionality has been disabled.


First of all thank you John and Ivus!
What I want is to have an external link instead of "add to cart" button. I did that with VM1 and Joomla 1.5. I checked the "use only as catalouge" and I made some changes in the flypage coding as below:

1- I opened the flypage (/components/com_virtuemart/themes/default/templates/product_details/flypage.tpl.php)
2- I replaced "<?php echo $addtocart ?>" with the following code:
<?php
if ($product_url == ""){
echo $addtocart;}
else
echo "<a target=\"_blank\" href=\"".$product_url."\"><img src=\"components/com_virtuemart/themes/default/images/buy.jpg\" alt=\"This is the alt\"></a><br/>";?>
3- You can see the result in the demo store product page I just built.
4- If you click on the green basket icon you will be redirected to the link (this topic) which I defined in the product configuration page.

Now I want to do the same with VM2 and Joomla 2.5 but I don't know how to do that since its different comparing to VM1.
For the demo store in case you need to access the administration:
User: admin
Password: test123


I would be really grateful if you could help! :)


John2400


pamchal

John thank you so much for the hint, I tried but unfortunately I still can't make it work! :(
Any suggestion guys?

ivus

Hi pamchal,

Now I'm understand what you want to do.

A few questions:

  • You say : "What I want is to have an external link instead of "add to cart" button" and also "which I defined in the product configuration page"... but how have you defined these? Is it a custom field?
  • What is your knowledge/understanding of PHP?

pamchal

Hi ivus,

Thanks for your time :)
About the questions:
1- In VM2 I have no idea how to do that but in VM1 as I explained, I change the coding of the flypage to show the url as an image at the product page. The url (external link) I put in VM1 is not a custom field. In the product configuration, there are some fields to fill: "Product SKU", 'Product Name", "Product Alias" and "url". In the url field I put the external link and I check the "use only as catalogue", then this link is shown at the product page as an image with the external link. I started to use VM2 just for a few days and I don't know how to perform this! I don't know how to change the coding of the product detail page (I think it is default.php) to show the link I put in the product configuration when I'm using VM2 as a catalogue!

2- Unfortunately I'm just a beginner!

Is there any chance you could help me?! :)

pamchal

#12
Hi!

Finally it worked! here I found a very good guide on VM2 template coding!

Thanks every one for your time and help :)

Jens

This seems to work:

Adding the following code to the default.php page in components/com_virtuemart/views/productdetails/tmpl where you want it to appear

Buy this product: <a href="<?php echo $this->product->product_url ?>"><?php echo $this->product->product_name ?></a>

Alternative could be an image link to a Buy Button image you loaded

rmikkenie

Hi,

I know this is an old topic, but I'm using the same versions and I want the same thing. The above mentioned works for me, except I'm using child products that are managed as stockable variants. I would like the product_url to link to an external website, but colour/size selection (we sell clothes) has to be done on my own VM-website. I can get the link to work only for the parent item.  How would it be possible to do colour/size selection and get the link that is specified at the appropriate child item under product_url?