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

Is there a faster way to test reordering lists?

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 03-07-2017, 06:52 PM
 
benlind benlind is offline
 

Member
  
Join Date: Feb 2016
Posts: 24
 

Default Is there a faster way to test reordering lists?

One of the biggest time-wasters in my x-cart development is redeploying my store every time I want to reorder a list item. The main problem is that I usually don't know the exact target weight for item's new location.

For example, I recently moved the "Free Shipping" label on individual product pages next to the Add to Cart button with this code:

PHP Code:
\XLite\Core\Layout::getInstance()->removeTemplateFromList(
    
'modules/XC/FreeShipping/free_ship.label.tpl',
    
'product.details.page.info'
);
\
XLite\Core\Layout::getInstance()->addTemplateToList(
    
'modules/XC/FreeShipping/free_ship.label.tpl',
    
'product.details.page.info.buttons-added.cart-buttons',
    array(
        
'zone'   => \XLite\Model\ViewList::INTERFACE_CUSTOMER,
        
'weight' => 32,
    )
); 

I had to change the 'weight' option multiple times, redeploying after every change, before I landed on the magic "32."

Is there a better way to test these types of weight changes without having to redeploy every time? I tried editing my module's Main.php in var/run/, but that did nothing.

Thanks!
__________________
X-Cart version 5.2
Reply With Quote
  #2  
Old 03-13-2017, 07:05 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Is there a faster way to test reordering lists?

X-Cart refreshes information on lists only when redeploying the site. So, there is no easier way to test (as far as I see).
However, you can check what weights other elements have in that list:
Code:
SELECT list_id AS id, class, child, tpl, weight FROM xc_view_lists WHERE list='product.details.page.info.buttons-added.cart-buttons' ORDER BY weight;
__________________
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
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



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 07:18 AM.

   

 
X-Cart forums © 2001-2020