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)
-   -   Can I add an image at the top of the {sale} page ? (https://forum.x-cart.com/showthread.php?t=74248)

affordabledesigns@rogers. 07-27-2016 05:32 AM

Can I add an image at the top of the {sale} page ?
 
I am using the SALE module. Any items on sale are displayed in the {sale} page. I would like to add an image at the top of that page only. How can I do that ?

Thanks
Denis - Canada
www.adcleeann.com

totaltec 07-27-2016 03:32 PM

Re: Can I add an image at the top of the {sale} page ?
 
I've looked at it, and it seems that the sale module uses default templates that are used to display products in a category. So it doesn;t have its own template to modify and achieve this.

So we would need to create a module, or extend a custom module that you have already created, and add our own template into the list. The viewer class in the module would need the getAllowedtargets() method to allow only "sale_products", and this would limit it to the sale page.

affordabledesigns@rogers. 07-27-2016 03:38 PM

Re: Can I add an image at the top of the {sale} page ?
 
How about creating a static page and including the {sale} page into it. Is that doable ?

PhilJ 07-27-2016 04:48 PM

Re: Can I add an image at the top of the {sale} page ?
 
lol, create a module... REALLY? Gimme a break...

(sorry Denis)

And sorry totaltec, but I'm amazed.

affordabledesigns@rogers. 07-27-2016 05:13 PM

Re: Can I add an image at the top of the {sale} page ?
 
So, I suspect creating a module is not everyone "solution". Anybody else has a suggestion ?

PhilJ 07-27-2016 05:30 PM

Re: Can I add an image at the top of the {sale} page ?
 
No Denis, sadly it seems it's the way. I trust totaltec implicitly, but just amazed.

I haven't explored v5.x and I probably won't knowing this.

cflsystems 07-27-2016 07:03 PM

Re: Can I add an image at the top of the {sale} page ?
 
In XC4 you can just modify existing template with an if statement for the main variable assigned to the page.
In XC5 if the module doesn't have its own template already you will have to create a module. Even if it has its own template it is way safer to create new module so your changes not to be overwritten with next upgrade.

Unfortunately the simpler the software is for the end user the more complicated it becomes to modify. A lot of my clients can do simple template changes to their XC4 carts. This is almost impossible task in XC5. You either have to know PHP OOP and Doctrine or you hire a developer. (Not sure if you do know PHP OOP and Doctrine why would you do anything else but developing...)

Bottom line is - even the simplest modification in XC5 requires changes to be done via custom module or you will lose them on next upgrade.

qualiteam 07-27-2016 11:11 PM

Re: Can I add an image at the top of the {sale} page ?
 
Implementing every custom modification as a module allows you to separate mods from the core and from each other.
If something goes wrong, you know what modules what change.
This is much easier to debug than multiple hacks mixed in core XC4 files, when you don't know why this code is there and what will happen if you remove it.

As for adding an image at the top of Sales page - you are to add the following template:
Code:

{*
 * @ListChild (list="center", weight="0")
 *}
{if:getTarget()=#sale_products#}
  <p class="sale-page-custom-head">
    <img src="URL_TO_YOUR_IMAGE_HERE" />
  </p>
{end:}


You can either create a new module, or do it from the CustomSkin module.

For a new module: follow the instructions and place the template to the skins/default/en/modules/YOUR_DEV_ID/YOUR_MODULE_ID/sale/ directory. Then enable the module.

For CustomSkin module: place the template to the skins/default/en/modules/XC/CustomSkin/sale/ directory and enable "Custom Skin" module in the backend.

PhilJ 07-28-2016 02:23 AM

Re: Can I add an image at the top of the {sale} page ?
 
Surely tiresome though?

Alright, mod after mod it is...

qualiteam 07-28-2016 02:35 AM

Re: Can I add an image at the top of the {sale} page ?
 
Yes, I understand.

You should think of XC5 modules differently.

In XC4 a module is a distribution package that includes a lot of changes. Creating such a module is a lot of work.

In XC5 a module is just a named bunch of changes to the source code that are required by a custom feature. You add files, click "Pack it" button and the module package is ready for installation on other websites. Or you can turn it on/off when needed (or for debugging purposes).

As these changes are isolated from the core, debugging and maintaining the module is easier than working with direct hacks to core files.

You are not required to create a module for every modification that you do. For example, you may group tweaks to the design into a single module and name it "My Custom Design".
Or you can have a single "Custom changes" module for everything that you do over your XC5 website.
But it makes sense to group changes by features so that you could then re-apply them to other websites (or sell through our marketplace website).

PhilJ 07-28-2016 02:45 AM

Re: Can I add an image at the top of the {sale} page ?
 
nah, not as simple for the lay-person, which is my market.

Quote:

I am using the SALE module. Any items on sale are displayed in the {sale} page. I would like to add an image at the top of that page only. How can I do that ?

That's why people are running off in droves or sticking with v4.x.

It's the truth.

There's so many alternatives out there.

PhilJ 07-28-2016 03:45 AM

Re: Can I add an image at the top of the {sale} page ?
 
I know mods are 'isolated from the core', but once you make a store your own, does it matter?

Merchants change store and design every couple years anyhow.

PhilJ 07-28-2016 03:50 AM

Re: Can I add an image at the top of the {sale} page ?
 
Instead of 1 hoop, you have to go thru 10.

It's nonsense.

totaltec 07-28-2016 04:31 AM

Re: Can I add an image at the top of the {sale} page ?
 
There is no doubt that its more tiresome and time consuming in XC5. Even last night as I replied to this, I remarked to my wife that it takes longer to investigate an XC5 change and suggest a solution than it does to make a change in XC4.

And yes we have the custom skin and the theme tweaker. The custom module that makes this change though, can be the module that makes all of the changes in your shop. So one module can be everything custom for your company.

PhilJ 07-28-2016 06:07 AM

Re: Can I add an image at the top of the {sale} page ?
 
No more comments.

qualiteam 07-28-2016 10:25 PM

Re: Can I add an image at the top of the {sale} page ?
 
Quote:

Originally Posted by PhilJ
I know mods are 'isolated from the core', but once you make a store your own, does it matter?


It matters when you doing the next major upgrade :-)

I think we should stop the off-topic there.

You can add an image to the Sale page with a small tweak as I described in this message:
https://forum.x-cart.com/showpost.php?p=398060&postcount=8


All times are GMT -8. The time now is 06:18 AM.

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