V4 development questions

  1. How do you clear the BACKEND temp;ate cache? Nothing I found seems to touch it. Only way I've found is via FTP.


  2. How are BACKEND styles.less files (or maybe styles.css) integrated into the combined/cached css? I don't see where it's being done. I've put a styles.less in design/backend/css/addons//styles.less but it's not being picked up. I noticed that the design/backend/css/addons/seo/styles.less is also not being picked up. I can delete the cached css files via FTP (not preferred method) but the newly deposited styles.less are not recompiled.


  3. Is there a way to collapse the stupid left panel in the admin mainbox so that when there's no search or other content that it is not shown? (the horizontal was much better from a screen management perspective)


  4. When debugging, is there a way to identify the real source of a class/property? With firebug it just sees everything in one big file.


  5. Seems like the system styles are overriding things like a size attribute in an input tag. I.e.



    still comes up with a wide box rather than a small box. I have to use a class to specify a width? Seems like an attribute of a tag should take precedence.

Have you got the Rebuild Cache Automatically set to On in the Template Editor section of Design?



My styles.less is being being picked up as are all my other changes with that set. Without it set none of the other clear cache options seem to do anything which sounds like what you're seeing.

Hi @tbirnseth,


[quote]How do you clear the BACKEND temp;ate cache? Nothing I found seems to touch it. Only way I've found is via FTP.[/quote]

you clear as normal with ?cc or &cc, depand of the url variables already present


[quote]How are BACKEND styles.less files (or maybe styles.css) integrated into the combined/cached css? I don't see where it's being done. I've put a styles.less in design/backend/css/addons//styles.less but it's not being picked up. I noticed that the design/backend/css/addons/seo/styles.less is also not being picked up. I can delete the cached css files via FTP (not preferred method) but the newly deposited styles.less are not recompiled.[/quote]

you need to hook styles, please check [color=#ff0000]design/backend/templates/addons/tags/hooks/index/styles.post.tpl[/color]


[quote]Is there a way to collapse the stupid left panel in the admin mainbox so that when there's no search or other content that it is not shown? (the horizontal was much better from a screen management perspective)[/quote]

can be done with javascript and make it like this [url=“Admin Lab Dashboard”]http://thevectorlab.net/adminlab/[/url] but in my opinion is not a big impact


[quote]Seems like the system styles are overriding things like a size attribute in an input tag. I.e…[/quote]

Please try





I hope that helps,





Valentin

[color=#808080][size=2]part of hungryweb.net[/size][/color]

Is the clear cache with ?cc or &cc a bug? As with NairdaCart, the only way I can clear cache is to change template setting to automatically clear cache.

Here's what I've learned so far after over a week of back and forth with the helpdesk and further code investigation.

  1. the backend (and frontend) template caches are cleared with the &ctpl parameter. &cc only does the registry.


  2. To get the files you've installed in /design/backend/css/addons/[your_addon]/styles.less to be loaded you must also include a hook in the addon at design/backend/templates/addons/[your_addon]/hooks/index/styles.post.tpl that contains

    {style src=“addons/[your_addon]/styles.less”}. When the addon is installed it will enable the less compiler to accept that location (getting pretty convoluted, why not just let me specify that actual location of the less file rather than specifying where it must go and then using a hook to enable it?)

    Still wating on what the programatic interface is for forcing a rebuild of the css files given that my addons can update automatically and I certainly don't want to request an admin setting of rebuild automatically for the rare event of needing to rebuild.


  3. Apparently they now acknowledge that this is actually a bug and it should behave like any other block. I.e. if it's empty, it should be collapsed.


  4. No way to identify the real source of a css class/property other than trying to dig through the combined css file and then grepping through the css directory structure for a match.


  5. Yes, standard cs-cart styles override any size attribute you may use and specify a 'width' property. So to get a small box, you would use class=“input-micro”…



    Lot of no-value changes to account for in V4 from an addon developer's perspective. As a merchant, it's not too bad. Gives more styling flexibility but really hate the left-nav for search and other options rather than the horizontal. Takes up too much real estate for what's in there.

hi,



I want to add some questions to this topic too.



First of all,



I am adapting v2 addon to v4. I am trying to modify orders & details pages on admin panel.



When the statuses change, I want it to make some additional actions.for this reason I modified select_popup.tpl, but in details page does not work when I click statuses.

some of page does not refresh itself via ajax. I saw status_target_id and there is order_summary

if I put this id ( there is no this id in the original details page ) after that it works,but it does not work properly,some of page dissappears. so I want to know what is wrong?



urgent help !!!



b. regards,

may

You might want to post code. Your description is difficult to follow at the detail level required.

Are you wanting an additional user interaction when status changes? Or do you just want to take certain actions when status changes to certain values?



Generally what you do in V2 you can do in V4 if you've done all the V4 changes to make it syntactically correct (without error).

hi



I changed codes to >

{foreach from=$items_status item=“val” key=“st”}



{if ($st == $smarty.const.SHIPPED_STATUS)}

{if ($status == $smarty.const.CREATED_INVOICE_STATUS || $status == $smarty.const.SHIPMENT_CANCELLED_STATUS || $status == $smarty.const.SHIPPED_STATUS)}


  • {if $status == $st}href="javascript:void(0);" {else}href="{"`$_update_controller`.one_order_shipped?order_id=`$id`&key_status=`$st``$extra_params``$dynamic_object`"|fn_url}"{/if}
    onclick="return fn_check_object_status(this, '{$st|lower}', '{if $statuses}{$statuses[$st].params.color|default:''}{/if}');"
    data-ca-event="ce.update_object_status_callback" name="one_order_shipped">{$val}

  • {else}
    {/if}
    {elseif ($st == $smarty.const.SHIPMENT_CANCELLED_STATUS)}
    {if ($status == $smarty.const.SHIPPED_STATUS || $status == $smarty.const.SHIPMENT_CANCELLED_STATUS)}
  • {if $status == $st}href="javascript:void(0);" {else}href="{"`$_update_controller`.one_order_shipped_cancelled?order_id=`$id`&key_status=`$st``$extra_params``$dynamic_object`"|fn_url}"{/if}
    onclick="return fn_check_object_status(this, '{$st|lower}', '{if $statuses}{$statuses[$st].params.color|default:''}{/if}');"
    data-ca-event="ce.update_object_status_callback" name="one_order_shipment_cancelled">{$val}

  • {else}
    {/if}
    {elseif ($st == $smarty.const.SHIPMENT_COMPLETED_STATUS)}
    {if ($status == $smarty.const.SHIPMENT_COMPLETED_STATUS)}
  • {if $status == $st}href="javascript:void(0);" {else} href="{"`$_update_controller`.update_status?id=`$id`&status=`$st``$extra_params``$dynamic_object`"|fn_url}"{/if}
    onclick="return fn_check_object_status(this, '{$st|lower}', '{if $statuses}{$statuses[$st].params.color|default:''}{/if}');"
    data-ca-event="ce.update_object_status_callback" name="update_object_status_callback">{$val}

  • {else}
    {/if}
    {else}
    {if ($status != $smarty.const.SHIPPED_STATUS)}
  • href="{"`$_update_controller`.update_status?id=`$id`&status=`$st``$extra_params``$dynamic_object`"|fn_url}"
    onclick="return fn_check_object_status(this, '{$st|lower}', '{if $statuses}{$statuses[$st].params.color|default:''}{/if}');"
    data-ca-event="ce.update_object_status_callback" name="update_object_status_callback">{$val}

  • {else}
    {/if}
    {/if}


    {/foreach}

    on select_popup.tpl

    I added this on orders.details tpl >
    {include file="addons/invoiceaddon/common/select_popup.tpl" suffix="o" id=$order_info.order_id status=$order_info.status items_status=$order_status_descr update_controller="orders" notify=true notify_department=true notify_vendor=$notify_vendor status_target_id="order_summary,order_extra_tools,content_downloads" extra="&return_url=`$extra_status`" statuses=$order_statuses}

    I added these to mainbox.tpl >



    {__("order")}  #{$order_info.order_id} {if $order_info.company_id}({__("vendor")}: {$order_info.company_id|fn_get_company_name}){/if}

    {if !empty($order_info.order_invoice)}


    {if ($order_info.order_invoice.invoice_state == $smarty.const.INVOICE_STATE_ENABLED) &&
    (($order_info.status == $smarty.const.CREATED_INVOICE_STATUS) || ($order_info.status == $smarty.const.SHIPMENT_CANCELLED_STATUS))}
    ({__("invoice_invoice_number")}: 
    #{$order_info.order_invoice.invoice_serial_code}-{$order_info.order_invoice.invoice_number})
    {else}
    ({__("invoice_invoice_number")}: #{$order_info.order_invoice.invoice_serial_code}-{$order_info.order_invoice.invoice_number})
    {/if}


    {/if}


    {if $order_statuses_data[$order_info.status].appearance_type == "C" && $order_info.credit_memo_id}


    {__("credit_memo")}: #{$order_info.credit_memo_id}


    {/if}

    {__("by")} 

    {if $order_info.user_id}{/if}{$order_info.firstname} {$order_info.lastname}{if $order_info.user_id}{/if} 
    {assign var="timestamp" value=$order_info.timestamp|date_format:"`$settings.Appearance.date_format`"|escape:url}
    {__("on")} {$order_info.timestamp|date_format:"`$settings.Appearance.date_format`"} {$order_info.timestamp|date_format:"`$settings.Appearance.time_format`"}{if $order_info.shipment.shipping}, {$order_info.shipment.shipping}{/if}
    {if $order_info.shipment.tracking_number} ({$order_info.shipment.tracking_number}){/if}


    {if ($smarty.const.YK_ADDON_NAME != 'YK_ADDON_NAME') && ($order_info.status == $smarty.const.SHIPMENT_COMPLETED_STATUS)}
    {if (!empty($order_info.shipments) and !empty($order_info.shipments.tracking_number))}


    {__("button_show_shipment_status")}


    {/if}
    {/if}




    but When I try to change statuses it does not refresh the details page. so those lines above do not be refreshed via ajax.

    I am trying to move addon from v2 to v4 and I saw that order_summary id to be set on v2 but there is not on v4

    v2 >





    v4>





    and when I set order_summary it does not work. the cycle does not finish itself. I looked response and order_summary set false there.

    I need urgent help.

    regards

    may.

    PS > I can give ftp and panel passwords

    I need urgent help I am in stuck!!!

    in addition



    if I set order_summary to arbitrary div



    I took this error on ajax.js



    [color=#AA0D91]if[/color][color=#000000] ([/color][color=#000000]data[/color][color=#000000].[/color][color=#000000]html[/color][color=#000000][[/color][color=#000000]k[/color][color=#000000]].[/color][color=#000000]indexOf[/color]color=#000000 != -[/color][color=#1C00CF]1[/color][color=#000000] && [/color][color=#000000]elm[/color][color=#000000].[/color][color=#000000]parents[/color]color=#000000.[/color][color=#000000]length[/color][color=#000000]) [/color][color=#000000]{[/color]



    [list]

    [][color=red !important]Uncaught TypeError: Object # has no method 'indexOf' ajax.js:368[/color]

    [list]

    [
    ]

    [color=red !important]_response[/color]ajax.js:368

    []

    [color=red !important]methods.request.$.ajax.success[/color]ajax.js:126

    [
    ]

    [color=red !important]b.Callbacks.c[/color]jquery.min.js:3

    []

    [color=red !important]b.Callbacks.p.fireWith[/color]jquery.min.js:3

    [
    ]

    [color=red !important]k[/color]jquery.min.js:5

    [*]

    [color=red !important]b.ajaxTransport.send.r [/color]

    [/list]

    [/list]



    [color=red]regards[/color]

    [color=red]may[/color]