Author Topic: "Add to Cart" button changes. Why?  (Read 1766 times)

sgodun

  • Beginner
  • *
  • Posts: 20
"Add to Cart" button changes. Why?
« on: December 01, 2009, 02:25:42 am »
Current versions of Joomla and VM. My site has about a half dozen pages (all articles, plus one ListMessenger page) plus the VM store. I'm using the "Random Item" module to show two random products from the store in the left column.

On any page that ISN'T in the VM store, the "Add to Cart" link in the random item area is a standard button (see example 1, below). On pages that ARE in the VM store, the "Add to Cart" link turns into a plain text link (see example 2, below).

Why? How to fix? (That is, how do I turn the plain text link into the button?)


[attachment cleanup by admin]

sgodun

  • Beginner
  • *
  • Posts: 20
Re: "Add to Cart" button changes. Why?
« Reply #1 on: December 01, 2009, 16:22:44 pm »
Okay, I think I've got something of a handle on what's happening but still not much on how to fix it.

I noticed that the plain text link had the same formatting as the "add-to-cart" graphic buttons in the store. I temporarily removed my "add-to-cart" graphic from my site, refreshed, and sure enough the buttons in the store looked exactly like the text in the random products module.

This leads me to believe that this is a CSS issue. I can only guess that there's a common style sheet being shared somewhere. Where, I don't know. Anyone have any ideas?

svenn

  • Beginner
  • *
  • Posts: 14
    • Q Media
Re: "Add to Cart" button changes. Why?
« Reply #2 on: December 01, 2009, 19:40:04 pm »
I've noticed this aswell..from what I could see this is caused by showing your sites template css while anywhere else THAN in VM. and while you're in VM it reads the styling from the VM theme.css.. So basically the styling of buttons differ in these css files and causes what you see I believe.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10352
  • VirtueMart Version: 3+
Re: "Add to Cart" button changes. Why?
« Reply #3 on: December 01, 2009, 20:57:12 pm »
In your template .css
add css to call the cart button

.addtocart_button_module {background:url(../images/add to cart image location.png) 0 0 no-repeat;}
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

sgodun

  • Beginner
  • *
  • Posts: 20
Re: "Add to Cart" button changes. Why?
« Reply #4 on: December 01, 2009, 22:14:56 pm »
In your template .css
add css to call the cart button

.addtocart_button_module {background:url(../images/add to cart image location.png) 0 0 no-repeat;}
Unless I'm understanding you wrong, this did not work.

I opened template.css of my Joomla theme (not my VM theme) and added the specified line, giving it the appropriate path from the root level of the server, as shown here:

../components/com_virtuemart/themes/default/images/add-to-cart_red.png

After making the change, the left column on the store page is the same as it was before, but the non-store pages have inexplicably picked up a new style (which is NOT my "add-to-cart_red.png" file) as shown in the attached example.



[attachment cleanup by admin]

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10352
  • VirtueMart Version: 3+
Re: "Add to Cart" button changes. Why?
« Reply #5 on: December 02, 2009, 03:20:19 am »
productsnapshop.tpl

You might can do this inline
<!-- The add to cart DIV. -->
<div style="float:left;text-align:center;width: 100%;background:url(../images/add to cart image location.png">
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

sgodun

  • Beginner
  • *
  • Posts: 20
Re: "Add to Cart" button changes. Why?
« Reply #6 on: December 03, 2009, 04:13:35 am »
Assuming you meant "productsnapshot.tpl.php", I tried your suggestion but still no joy. I'm back to the original examples I posted in my first message.