Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

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

 
Closed Thread
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 07-27-2016, 05:32 AM
  affordabledesigns@rogers.'s Avatar 
affordabledesigns@rogers. affordabledesigns@rogers. is offline
 

Newbie
  
Join Date: Jun 2016
Location: Ottawa Canada
Posts: 8
 

Default 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
__________________
Denis Bastien
www.adcleeann.com
  #2  
Old 07-27-2016, 03:32 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.

The following user thanks totaltec for this useful post:
qualiteam (07-27-2016)
  #3  
Old 07-27-2016, 03:38 PM
  affordabledesigns@rogers.'s Avatar 
affordabledesigns@rogers. affordabledesigns@rogers. is offline
 

Newbie
  
Join Date: Jun 2016
Location: Ottawa Canada
Posts: 8
 

Default 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 ?
__________________
Denis Bastien
www.adcleeann.com
  #4  
Old 07-27-2016, 04:48 PM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default 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.
__________________
xcartmods.co.uk
  #5  
Old 07-27-2016, 05:13 PM
  affordabledesigns@rogers.'s Avatar 
affordabledesigns@rogers. affordabledesigns@rogers. is offline
 

Newbie
  
Join Date: Jun 2016
Location: Ottawa Canada
Posts: 8
 

Default 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 ?
__________________
Denis Bastien
www.adcleeann.com
  #6  
Old 07-27-2016, 05:30 PM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default 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.
__________________
xcartmods.co.uk

The following user thanks PhilJ for this useful post:
totaltec (07-28-2016)
  #7  
Old 07-27-2016, 07:03 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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.
__________________
Steve Stoyanov
CFLSystems.com
Web Development

The following user thanks cflsystems for this useful post:
qualiteam (07-27-2016)
  #8  
Old 07-27-2016, 11:11 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
  #9  
Old 07-28-2016, 02:23 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

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

Surely tiresome though?

Alright, mod after mod it is...
__________________
xcartmods.co.uk
  #10  
Old 07-28-2016, 02:35 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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).
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Closed Thread
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020