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

Moving price on product page

 
Reply
   X-Cart forums > X-Cart 5 > Modifying the design and features (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 08-01-2020, 05:06 PM
 
ilclark ilclark is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: Brisbane, Australia
Posts: 92
 

Default Moving price on product page

Hi all, I'd like to perform a small layout modification, just moving the price field above the product brief description field.

Hey X-Cart 5 has a template editor, this should be quick and easy!

I'm assuming it's me, initially great pretty intuitive, but then no, I can't just select drag and drop, why not? Now I get frustrated, can't seem to get my head around this.

I read the template editor doco, why can't I get it to work in a similar way as the invoice example? Must be me but what am I doing wrong??

Anyone?

Thanks,
Iain
__________________
X-Cart 4.6.1 --> 5.4.1.9 (Nearly!!)
LiteCommerce 2.2.21 (RIP)

www.nextmobile.com.au
Reply With Quote
  #2  
Old 08-03-2020, 02:36 AM
  pauldodman's Avatar 
pauldodman pauldodman is online now
 

X-Man
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 2,999
 

Default Re: Moving price on product page

Have you tried using the template editor and just moving the price code where you want it to be? ie cut and paste the code rather than trying drag and drop.
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote

The following user thanks pauldodman for this useful post:
Ed B. (08-03-2020)
  #3  
Old 08-04-2020, 03:35 PM
 
ilclark ilclark is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: Brisbane, Australia
Posts: 92
 

Default Re: Moving price on product page

Hi Paul, I got it to work by creating a new template, cutting the code from the original position and pasting it into my new template.

Possibly the way to do it but it just felt less intuitive than being able to drag or renumber a section to a new spot?

Especially when on the layout editor you can drag and drop, albeit larger sections of functionality, ie I swapped Related Products and the Customers Also Bought sections quickly and easily.
__________________
X-Cart 4.6.1 --> 5.4.1.9 (Nearly!!)
LiteCommerce 2.2.21 (RIP)

www.nextmobile.com.au
Reply With Quote
  #4  
Old 08-04-2020, 04:44 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 13,920
 

Default Re: Moving price on product page

The drag and drop works only on individual sections or modules if you'd like but not within sections. It's basically helpful for large individual sections nothing else.

To move these templates on the page you should use the ListChild declaration and reassign its weight for the different templates within the same list. If they are within different lists you will have to reassign the list and the weight for the template you want to move.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 08-04-2020, 07:41 PM
 
ilclark ilclark is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: Brisbane, Australia
Posts: 92
 

Default Re: Moving price on product page

It must be me, but not sure how to implement that, see attached of what I did to get it to at least work.
Attached Thumbnails
Click image for larger version

Name:	Image1.png
Views:	43
Size:	148.1 KB
ID:	5537  
__________________
X-Cart 4.6.1 --> 5.4.1.9 (Nearly!!)
LiteCommerce 2.2.21 (RIP)

www.nextmobile.com.au
Reply With Quote
  #6  
Old 08-05-2020, 04:00 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 13,920
 

Default Re: Moving price on product page

You cannot do this from the template editor. You need to create new module and do it in there.
Reassign the template (move it) within a list of templates.
Unfortunately the XC documentation lacks howtos and explanations what's what big time. Your best help is existing code.


Here is an example from the CrispWhite theme


Code:
protected static function moveTemplatesInLists() { $templates = [ ........ 'layout/content/main.location.twig' => [ static::TO_DELETE => [ ['layout.main', \XLite\Model\ViewList::INTERFACE_CUSTOMER], ], static::TO_ADD => [ ['center.top', 1000, \XLite\Model\ViewList::INTERFACE_CUSTOMER], ], ], ........ ]; }


Moving the main.location.twig template from "layout.main" list to "center.top" list and giving it weight of 1000.
So you need to find the list the template you want to move belongs to and the list you want to move it to - in your case "product.details.page.info"


Code:
protected static function moveTemplatesInLists() { $templates = [ 'TEMPLATE YOU WANT TO MOVE - PATH RELATIVE TO SKINS/CUSTOMER/' => [ static::TO_DELETE => [ ['product.details.page.info', \XLite\Model\ViewList::INTERFACE_CUSTOMER], ], static::TO_ADD => [ ['product.details.page.info', 99, \XLite\Model\ViewList::INTERFACE_CUSTOMER], ], ], ]; }

This goes in your_module_root/Main.php
I don't think you can do this with the templates modified through the template editor though.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following 2 users thank cflsystems for this useful post:
DreamCatcher (09-14-2020), johngwms (08-14-2020)
Reply
   X-Cart forums > X-Cart 5 > Modifying the design and features (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 02:05 AM.

   

 
X-Cart forums © 2001-2020