Changing the 'Buy' or 'Add to Basket' links

Feb 17, 2009 at 1:16 AM
Is it possible to change the 'Buy' hyperlink to an image?  Say create a 'AddToCart.gif' and have that hyperlinked with the same functionality.

I was also wondering whether it's possible to replace the categories name by an image?  This is not critical...

Thank You

Paul
Coordinator
Feb 17, 2009 at 7:45 AM
Hi Paul,

1) Yes, create the html needed to display the button into a setting called "buybutton.text" in the "manager menu>settings".  Something like this [<img src="/Portals/0/addtobasket.jpg" border="0"/>]
2) You can do the same for category name by putting the html into the category name field, it will then display an image in place of the category name.  I've not tested this on any beta sites, so I'm unsure of any other affects this may have on category operation.  So test it before you trust it!!

Let me know if you find any problems with this.

Regards,
Dave.
Mar 8, 2009 at 6:45 PM
Related to this, "out of the box", the NB_Store minicart has a very nice shopping cart graphic. In most stores I have used, clicking on this shopping cart icon takes you to the cart. This is an easy change to the minicart.template in the Templates area of manager.

First navigate to your shopping cart page and copy the URL. 

Next change the HTML to read:

<p><a href="http://yoururl.com" ><img alt="" border="0" src="/DesktopModules/NB_Store/img/cart.png" /></a><br /> <font class="minicartnormal">Cart&#160;[Cart:Qty] article(s) :&#160; $[Cart:OrderTotal]</font></p>

Don't forget to substitute the URL you copied for the http://yoururl.com.
Jul 2, 2009 at 9:13 PM
Edited Jul 2, 2009 at 9:34 PM

I have the latest version of NB_store, 01.01.06, and I am unable to find "buybutton.text" anywhere.   From the documentation, I guess it should be under BackOffice/Utilities/Settings but I do not see anything in regards to the buy button.   I would like to change the link to a button.     Is there now a different method for updating this link for the TAG:ADDTOBASKET

Edit...

I found the CSS setting for the product list settings allowing me to add an image, so I guess I need a little help on how to change the text from "Buy" to someting else, or to remove it and use only an image as the button.   (my ignorance is being exposed).

Thank you,
Terence  

Jul 2, 2009 at 10:51 PM

Terrence:

Just add a new item called "buybutton.text" under the Utilities>Settings section and put your html there.

Have a Great Day!

Larry

 

Jul 3, 2009 at 12:57 AM

Oh my.   That is way too easy.

Thank you Larry.

Jul 6, 2009 at 5:54 PM

The ability to change a sub-category name to a graphic is exactly what I was looking for! It's great and seems to be working without any side-effects at this time. I do have two questions, though:

1. Where can I enlarge the [<img ... />] text input string in the Name field? Because I'm using GoDaddy, my application is running from a sub-directory, so I need a lot of space to define my image filenames.

2. Is there a way to display the Description along with the graphic for the sub-category menu? I suppose I can add it to the graphic, but that seems kind-of clugey...

Thank you!

 

Coordinator
Jul 6, 2009 at 6:36 PM

Hi dbs,

If your runnig version 1.1.6 then you have the option of using a tempate in the category menu, you can use a tag name of [TAG:CATEGORYNAME] so that you can point the image to a particular place. (e.g. <img src="/Portals/0/img/[TAG:CATEGORYNAME].jpg" />) the images will have to match the category name of course, but it does allow some flexibility.

Hope this makes sense?

Regards,

Dave.

Jul 7, 2009 at 1:15 AM

Your reply does make sense, and will be very clean and neat to implement.  I'm not sure what I'm doing wrong. Here's what I have, so far:

  1. I built a template named subcategoryimage.text that has the html as you described (with the correct directory) and the [TAG:CATEGORYNAME] underneath the image to reflect the sub category menu name.
  2. I've renamed the img file to match the sub-category menu name eg. "sub menu name.jpg".
  3. I've modified the Category Menu module that currently only shows the sub-menus, and under the "Sub Name Template:" I've specified the "subcategoryimage.text" template that I created.

The sub menu just shows "subcategoryimage.text" for all the submenu names.

Oh, and yes, it's version 1.1.6

Thanks for your help!

Jul 7, 2009 at 3:36 AM

I've managed to get it to work - without a template. I must have misunderstood how to build a template. Anyway, I just entered the actual html that I had in the template directly into the subcategory menu module's field for "Sub Name Template:" , including the [TAG:CATEGORYNAME] and it works fine! Thanks!

Clearly, I had not defined the template correctly, for it was not finding it / applying it. I think my default/Fr/US template settings are weird. Whenever I go into the HOST tab of the NBStore management, I see the FR setting... Anyway, that's for another day.

Coordinator
Jul 7, 2009 at 6:51 AM

Hi,

Yes, sorry I should have explained, the templates in the settings of the category menu are the actual coded needed for the template, not a link to the template.  This comes from the fact the category menu was originally taken from a different project and adapted, I didn't change any code to move it under the templating system because I thought it would run quicker with the settings cache. (Althought in 1.1.7 I've cached the settings and templates to improve speed).

The Host tab and "FR" settings, is an issue I've look at and works differently in v1.1.7, hopefully less confusing!

Regards,

Dave.

Jul 14, 2009 at 5:14 PM

That was way too easy. I did push the envelope, however, and added an "orderbutton.text" with html to reflect "Check Out" instead of the "Order", but it didn't work. Any other nifty tricks to accomplish this? Thanks!

Jul 15, 2009 at 2:35 AM

Nevermind. Got it.

Jul 15, 2009 at 2:44 AM

Hi DBS,

Would you mind sharing how you got it to work?

Have a Great Day!

Larry

Jul 15, 2009 at 3:32 AM

Hi Larry,

Sure. I went in the CheckOut.ascx.resx file and changed the text directly in that file via my text editor.

Now, I'm trying to change the "Waiting for Cheque" to "Check" in the ManagerMenuDefault.xml, but I'm not seeing the effect of my mods in the .xml file. I'm not really sure about .xml files - do I need to reassemble/recompile it somehow rather than just uploading it into the templates directory?

Thanks for any help out there!

Coordinator
Jul 15, 2009 at 7:01 AM

Hi,

 

The "Waiting for Cheque" for in a bit more tricky, it's in the DB table,  you can do what you suggest by changing the xml file and then importing it or run this SQL from DNN menu Host>SQL and it should update it:

 

update NB_Store_OrderStatus
set OrderStatusText = 'Waiting for Check'
where OrderStatusID = 80

 

 

 

Jan 19, 2010 at 3:00 PM

Hello leedavi!

Please help me with changing the buy button into a image. I don't get to this! I tried what you sed in the second post in this topic... but nothing: Create a buybutton.text item in Settings first... The code inside this item is: [<img src="/ro/Portals/0/images/cumpara-btn.jpg" />]... It doesn't work... Then I create a buybutton.text in templeate containing the same line. I don't get it to work. I'm still having "Buy".

Please explain me if i made something wrong!

Thank you!

Jan 19, 2010 at 5:36 PM

Hi,

Herewith the setting I have made

add a buybutton.text in utilities->templates

Below is the content of my buybutton.text setting.
Is consist out of 3 images.

- left handle_bar image
- middle handle image (with the text buy)
- right handle_bar image

hope this wil help

Regards, Ton Hermes

<img height="24" alt="" width="8" align="absMiddle" border="0" src="/Portals/26/Images/Web/gel_left.gif" /><img class="Buy" height="24" alt="" align="absMiddle" border="0" src="/Portals/26/Images/Web/gel_background_en.gif" /><img height="24" alt="" width="8" align="absMiddle" border="0" src="/Portals/26/Images/Web/gel_right.gif" />

Coordinator
Jan 19, 2010 at 9:07 PM

Hi,

I think buybutton.text should be created in the "BackOffice--->settings"... apart from that what Ton says should be OK.........(and I agree, it should have been in the BackOffice>Templates!!)

Dave.

Coordinator
Jan 20, 2010 at 12:38 AM

I can confirm...

Utilities, Settings, create: buybutton.text

content: <img height="xx" alt="whatever" width="xx" border="0" src="path to image" />

That works, and without having to restart the app.

Rob

Apr 19, 2010 at 3:51 PM

Very strange thing Dnn 5.3 NBStore 2.0.11

The icon of Add to shopping cart doesen't appear?

default productdetail.template file

added in template buybutton.text

<img alt="Aggiungi" align="absMiddle" border="0" src="/Portals/0/img/cart.png" />

Bu nothing appear.
Strange is the 4th installation and in the others all goes well........

thanks

rmartin

 

Apr 19, 2010 at 3:59 PM

Solved....
add  buybutton.text  it in the Setting not in the template!!!!

 

Coordinator
Apr 20, 2010 at 5:43 AM
Yes, it's in the wrong place really..(Legacy issue!!)...I'm looking at moving it into the templates for the next version.