X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Diferent backgroundfor every product (https://forum.x-cart.com/showthread.php?t=77827)

Sancho Pantches 05-25-2020 05:46 AM

Diferent backgroundfor every product
Is there a way to have different background, and colors, per product?
Like use product ID for the CSS switching?
Kind regards

Ed B. 07-06-2020 11:33 PM

Re: Diferent backgroundfor every product
Is it good enough for you if the set of different colors are hard-coded in the module? If yes, it is not too difficult.

If no, I could imagine a couple of possibilities which look either difficult or impossible, but here they are
  • One could put a js to modify the css according to the productId. The problem here is I don't know how to feed the productId into js.
  • One could let the module write css files, let's say, when module parameter gets set up. One of he difficulties is, I don't know if there is a "X-cart" way of writing a file. But after all, a php code is a php code, so this should be possible. But then, the second problem is, is the path to module css files writable by http server?

All times are GMT -8. The time now is 12:36 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.