VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Themes & Layout Problems and Customization VM 1.1 => Topic started by: yachzo on February 20, 2010, 16:45:47 pm

Title: CSS background image path broken on shared hosting
Post by: yachzo on February 20, 2010, 16:45:47 pm
I have been trying out Virtuemart 1.1.4 on Joomla 1.5.11. I have an issue with background images not showing up on any Virtuemart section of my site, including the admin areas. They work properly on my localhost. I know it has to do something with the way virtuemart dynamically loads the style sheet and javascript files. Funny thing is that all of my styles work fine, its just the background images that get lost. When I use firebug, I get this path :

Code: [Select]
url(http://www.starvingeye.com/components/com_virtuemart/fetchscript.php?gzip=0&subdir[0]=/themes/default&file[0]=theme.css&subdir[1]=/themes/default&file[1]=admin.styles.css&subdir[2]=/js/admin_menu/css&file[2]=menu.css&subdir[3]=/js/extjs2/css&file[3]=ext-all.css&subdir[4]=/js/extjs2/themes/default/images/administration/menu/icon-16-import.png)
I know if I call my theme.css file from my joomla index.php page it will work fine, but I would rather find a fix to this system of loading the css from virtuemart.

I have gone over all of my settings on my configuration.php and my viruemart.cfg.php and they seem to be fine.

Since I had already toyed with SEF, gzip and caching on one site, I did a clean install on another shared hosting account (both on 1and1 shared hosting accounts) and experienced the same problems.

Is there any known issues with using virtuemart on a 1and1 shared hosting account, that I need to be aware of?

Hopefully somebody can steer me in the right direction, because this is driving me buggy.
Title: Re: CSS background image path broken on shared hosting
Post by: jenkinhill on February 21, 2010, 00:47:26 am
Is there any known issues with using virtuemart on a 1and1 shared hosting account, that I need to be aware of?

There are many potential issues with cheaper shared hosts that can cause problems running Joomla & Virtuemart. In this case it is most likely related to the url you are using for the bg image. I assume it is assigned in template.css, but for some hosts it also has to be declared in the VirtueMart theme.css - append the css to the end of the style sheet.
Title: Re: CSS background image path broken on shared hosting
Post by: yachzo on February 21, 2010, 02:14:20 am
This is what is calling the style sheet, in components/com_virtuemart/themes/mytheme/theme.php

Code: [Select]
if( vmIsJoomla('1.0') && mosGetParam($_REQUEST,'option') != VM_COMPONENT_NAME) {
// This can only be a call from a module or mambot
// In Joomla 1.0 it is not possible to add a JS or CSS into the HEAD from a module or content mambot,
// using addcustomheadtag, that's why we just print the tags here
echo vmCommonHTML::scriptTag(VM_THEMEURL.'theme.js');
echo vmCommonHTML::linkTag(VM_THEMEURL.'theme.css');
} else {
$vm_mainframe->addScript( VM_THEMEURL.'theme.js' );
$vm_mainframe->addStyleSheet( VM_THEMEURL.'theme.css' );
}
class vmTheme extends vmTemplate  {

function vmTheme() {
parent::vmTemplate();
vmCommonHTML::loadMooTools();
}

This is how the images are called from the theme.css:
Code: [Select]
.addtocart_button {
background: url( images/add-to-cart_blue.gif ) no-repeat  center transparent;
}

*note: i have also tried with it as:
Code: [Select]
.addtocart_button {
background: url( 'images/add-to-cart_blue.gif' ) no-repeat  center transparent;
}

theme.css is located in components/com_virtuemart/themes/mytheme/theme.css

For the administrative page the styles are coming from admin.styles.css also from the above directory.

That is the arrangement set up with the default template in virtuemart.

I thought they called the css and js files that way so you didn't have to call them for all of the non-virtuemart pages that don't need them, but anyhow I still haven't found why it's breaking.
Title: Re: CSS background image path broken on shared hosting
Post by: jenkinhill on February 21, 2010, 12:16:59 pm
Try using full urls for the bg images.
Title: Re: CSS background image path broken on shared hosting
Post by: yachzo on February 23, 2010, 17:58:55 pm
That doesnt work. Also that fetchscript is breaking my js files too making the add to cart button inactive. I know I could just call everything from my Joomla css file, using full urls for everything linked in, but that will make every page more bulky than needed.

I will apply that bandaid if I really have to, but I would rather fix it properly.

I would rather call everything needed by vm with vm and not have to load all that extra stuff for my regular joomla pages.
Title: Re: CSS background image path broken on shared hosting
Post by: PRO on February 23, 2010, 18:22:33 pm
did you change the urls in your virtuemart config file?

Title: Re: CSS background image path broken on shared hosting
Post by: yachzo on February 23, 2010, 18:47:39 pm
The urls in my vm config file is the same as the url in my joomla config file. The only difference is the / at the end.

Joomla's config file url:= http://www.caferacerypsi.com

and the virtuemart.cfg.php url= http://www.caferacerypsi.com/

I have tried both with and without the www, with same results.
Title: Re: CSS background image path broken on shared hosting
Post by: PRO on February 23, 2010, 19:13:19 pm
give me a url to your shop part of the site, and I will check it out
Title: Re: CSS background image path broken on shared hosting
Post by: yachzo on February 23, 2010, 20:06:20 pm
Ok well I have another site set up just for testing this out on the same host with the default joomla and vm settings, sample data and templates at: http://www.starvingeye.com/index.php?option=com_virtuemart&Itemid=53

The javascript for the add to cart seems to be working for the most part, but  the background images are still acting up.


*notice the add to cart button, and the up/down quantity arrows on the product details pages.
Title: Re: CSS background image path broken on shared hosting
Post by: PRO on February 23, 2010, 20:47:41 pm
attached



[attachment cleanup by admin]
Title: Re: CSS background image path broken on shared hosting
Post by: yachzo on February 23, 2010, 21:02:37 pm
*scratches head

Still not showing up for me. I'm using the latest version of Firefox. I have cleared my cache a million times and still don't see the images.

Same with IE 8.

(http://)

[attachment cleanup by admin]
Title: Re: CSS background image path broken on shared hosting
Post by: PRO on February 23, 2010, 21:48:32 pm
i used firefox
Title: Re: CSS background image path broken on shared hosting
Post by: yachzo on February 23, 2010, 22:36:02 pm
How about on this page?

http://www.caferacerypsi.com/Art/2010-Pinup-Calendar/flypage_tableless.tpl.html


It's got some style issues still I know, and it's a work in progress, but I got held up with this issue.
Title: Re: CSS background image path broken on shared hosting
Post by: PRO on February 24, 2010, 14:18:55 pm
i see it,


 I just noticed you are using SEF, that might break the stylsheet
Title: Re: CSS background image path broken on shared hosting
Post by: yachzo on February 24, 2010, 17:32:02 pm
Yeah on that last one I have SEF going on, that is why I was testing everything out on the other domain (starvingeye.com) without the SEF mods until i solved this problem.

Thanks for checking for me, but I'm still scratching my head on why I am not seeing the images. If I figure it out I will post here and mark this thread as solved.

Oh another note: I looked on firebug again and now notice that I do get '400 bad request' errors on those images if that means anything.
Title: Re: CSS background image path broken on shared hosting
Post by: PRO on February 24, 2010, 19:39:08 pm
analyze it with httpfox

Title: Re: CSS background image path broken on shared hosting
Post by: yachzo on February 24, 2010, 20:34:14 pm
Thanks for the tip!

HttpFox looks like I will be getting lots of use out of it in the future.

I did find something interesting with it, if this means anything. It showed me some funny image paths, putting the directory of js/slimbox/ before my /themes folder.

[attachment cleanup by admin]
Title: Re: CSS background image path broken on shared hosting
Post by: PRO on February 24, 2010, 20:35:25 pm
stuff like that usually happens with SEF
Title: Re: CSS background image path broken on shared hosting
Post by: yachzo on February 24, 2010, 20:46:46 pm
This is probably for another forum, and possibly too broad of a question, but is there anything one can do to achieve SEF with virtuemart? I have sh404sef, which I noticed has the option to turn off SEF by component. I turned it off for my shop pages and the url for the page looks as if the SEF is truly turned off: http://www.caferacerypsi.com/index.php?page=shop.product_details&product_id=1&category_id=2&flypage=flypage_tableless.tpl&option=com_virtuemart&Itemid=27&vmcchk=1&Itemid=27

however all problems still exist and they exist also on my vm component admin pages.
Title: Re: CSS background image path broken on shared hosting
Post by: PRO on February 24, 2010, 20:52:31 pm
you can always overwrite the vmart files with a clean version and see if that helps

BACKUP FIRST THOUGH
Title: Re: CSS background image path broken on shared hosting
Post by: yachzo on February 24, 2010, 21:07:31 pm
Yeah I was thinking about/fearing doing that too. I will try to get it right on my test server first but so far im getting a few related issues on that one too. Im thinking another hosting provider possibly too.

If this means anything, on my test server (same provider and package, different account) I get the same funny issues with the bkground images, but on my front-end I am getting the add to cart button, and I got it after I turned on my sh404sef using the .htaccess (no index.php in the url). I continue to scratch my head.

I should also note that the admin side bkgnd images will work sometimes randomly after clicking apply on some of the vm menus, only to disappear again after selecting another menu item.

[attachment cleanup by admin]
Title: Re: CSS background image path broken on shared hosting
Post by: donaldbane on February 26, 2010, 08:04:29 am
yachco,

Im following you from the other thread.

Same problem, the 'add to cart' and the ^ quantity image are playing up. The icons on the backend of vm (save and apply) appear and disappear. This is at the same time as the 'add to cart' and ^ images appear and disappear. Changed template when images not displaying - still not displaying. Im with Hostmonster, no Sef.

Following with interest.

Title: Re: CSS background image path broken on shared hosting
Post by: yachzo on February 27, 2010, 06:57:56 am
It's good to know I'm not the only one with this problem, if at least it helps me think im not crazy.

Have you messed with SEF urls on your site?
Title: Re: CSS background image path broken on shared hosting
Post by: donaldbane on February 27, 2010, 12:45:14 pm
Have not used sef at all. :(

Im thinking about reinstalling virtuemart. But need to google a lot to see how that is done without having to put all the products back in. Might also update from 13 to 14. Then try different templates. Possibly shift to some free server. Have all these 5 things going on seperatly, and see what it is that cures it! But might take a week.

Both the add to cart and ^, and the virtuemart back icons disappear at the same time. 80% of the time they are there.
Title: Re: CSS background image path broken on shared hosting
Post by: PRO on March 01, 2010, 15:45:47 pm
you can just overwrite the files without messing with the products


You just download a current version, and FTP the files over
Title: Re: CSS background image path broken on shared hosting
Post by: yachzo on March 10, 2010, 07:41:31 am
I decided to just link the theme.css file from my Joomla template index.php file and that fixed the images on the front end. I restored some of the images on the admin end by adding:
Code: [Select]
<link rel="stylesheet" href="/components/com_virtuemart/js/admin_menu/css/menu.css" type="text/css" /> to admin/templates/khepri/index.php

I still have issues with the gray button background images on the admin side, but all the images called from menu.css are showing up.

This is still not a proper fix and adds extra bulk to the site, but it lets me continue for now.

I still suspect an issue with the way vm handles css files with gzip failing on some shared hosting packages.