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)
-   -   Is there a faster way to test reordering lists? (https://forum.x-cart.com/showthread.php?t=75069)

benlind 03-07-2017 06:52 PM

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!

qualiteam 03-13-2017 07:05 AM

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;


All times are GMT -8. The time now is 01:48 AM.

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