Jump to content
thirty bees forum

zen

Members
  • Posts

    431
  • Joined

  • Last visited

  • Days Won

    60

Posts posted by zen

  1. For you only, because you know the results and it fits your needs, here is the modified code :

       // Will update default category with the first new one given. Home if no category at all.
    	if (isset($product->id_category[0])) {
                $product->id_category_default = (int) $product->id_category[0];
            } else {
                $defaultProductShop = new Shop($product->id_shop_default);
                $product->id_category_default = Category::getRootCategory(null, Validate::isLoadedObject($defaultProductShop) ? $defaultProductShop : null)->id;
            }

    et voilà...  and if we have a button.. or the new column.. then the deleted IF condition will take car of it... So Simple ^^

  2. Like you said, you CAN use the csv to update infos.. but it's not really his purpose, the main goal for csv is to import products on an empty shop, then more options have been added, So you can do whatever you want for that,

    In my case, I update default cat by SQL queries, directly on phpmyadmin, so fast and so efficient, I don't bother using csv.

    On your github issue it resumes what I said to you :

    Solution 1 : Adding a column in import file with default value

    or  Solution 2 : Create a checkbox in the form

    If this have been really usefull, and used by many.. this will have been done since a long time, but now you are the second to ask it, maybe it will be done soon.

  3. If your product is already setup, and you upload more infos... would you like theses previous infos to be deleted ?? I don't ! It will kill the shop for most of users.

    And When you give categories to add to your product, wich one is the default one ?? the first one ? the last one ?? the one in the middle maybe ?? or by cat ID ordered INC or DESC... who knows : So I tel you again this is not a BUG ! even if it doesn't suits your own needs on that case.. it the best for most users, now you can add one more column for DEFAULT CAT and update the script so it will assign that and remove the old one.

    Read the comments in the code, it's only logic.

     

  4. 8 minutes ago, Theo said:

    Hi Zen

    Thanks for the feedback. Yes, this is what I'm looking for. I will have a look at this code and see if I can figure it out and make it do what I want it to do.
    The only thing is: surely what the system doing is a bug? 
    Because, unless I'm mistaken, the system should always allow you to update a target product's category and then set this category as default (via CSV Import update)?

     

    It is not a bug.. it is a functionnality 🙂 lol

    CSV import is good and doing what you want on the first import.. if your product has already a dafault category setup, the csv import will not update that default category assigned, if you want it different you have to change the code.

    On my opinion it is totally normal behaviour, better not delete the default category with csv... just adding more is better option I think, it will need maybe a new column to force default category ID to be setup and everybody will be happy then.. have to think about adding it to csv import system.

  5. in the community-theme-default, you'll have to edit "address.tpl" file

    starting line 103

          {if $field_name eq 'postcode'}
            {assign var="postCodeExist" value=true}
            <div class="required postcode form-group unvisible">
              <label for="postcode">{l s='Zip/Postal Code'} <sup>*</sup></label>
              <input class="is_required validate form-control" data-validate="{$address_validation.$field_name.validate}" type="text" id="postcode" name="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{else}{if isset($address->postcode)}{$address->postcode|escape:'html':'UTF-8'}{/if}{/if}">
            </div>
          {/if}
          {if $field_name eq 'city'}
            <div class="required form-group">
              <label for="city">{l s='City'} <sup>*</sup></label>
              <input class="is_required validate form-control" data-validate="{$address_validation.$field_name.validate}" type="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{else}{if isset($address->city)}{$address->city|escape:'html':'UTF-8'}{/if}{/if}" maxlength="64" required>
            </div>
            {* if customer hasn't update his layout address, country has to be verified but it's deprecated *}
          {/if}
          {if $field_name eq 'Country:name' || $field_name eq 'country' || $field_name eq 'Country:iso_code'}
            <div class="required form-group">
              <label for="id_country">{l s='Country'} <sup>*</sup></label>
              <select id="id_country" class="form-control" name="id_country" required>{$countries_list}</select>
            </div>
          {/if}
          {if $field_name eq 'State:name'}
            {assign var="stateExist" value=true}
            <div class="required id_state form-group">
              <label for="id_state">{l s='State'} <sup>*</sup></label>
              <select name="id_state" id="id_state" class="form-control">
                <option value="">-</option>
              </select>
            </div>
          {/if}

    and change it for that :

          {if $field_name eq 'city'}
            <div class="required form-group">
              <label for="city">{l s='City'} <sup>*</sup></label>
              <input class="is_required validate form-control" data-validate="{$address_validation.$field_name.validate}" type="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{else}{if isset($address->city)}{$address->city|escape:'html':'UTF-8'}{/if}{/if}" maxlength="64" required>
            </div>
            {* if customer hasn't update his layout address, country has to be verified but it's deprecated *}
          {/if}
    	{if $field_name eq 'State:name'}
            {assign var="stateExist" value=true}
            <div class="required id_state form-group">
              <label for="id_state">{l s='State'} <sup>*</sup></label>
              <select name="id_state" id="id_state" class="form-control">
                <option value="">-</option>
              </select>
            </div>
          {/if}
    	{if $field_name eq 'postcode'}
            {assign var="postCodeExist" value=true}
            <div class="required postcode form-group unvisible">
              <label for="postcode">{l s='Zip/Postal Code'} <sup>*</sup></label>
              <input class="is_required validate form-control" data-validate="{$address_validation.$field_name.validate}" type="text" id="postcode" name="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{else}{if isset($address->postcode)}{$address->postcode|escape:'html':'UTF-8'}{/if}{/if}">
            </div>
          {/if}
          {if $field_name eq 'Country:name' || $field_name eq 'country' || $field_name eq 'Country:iso_code'}
            <div class="required form-group">
              <label for="id_country">{l s='Country'} <sup>*</sup></label>
              <select id="id_country" class="form-control" name="id_country" required>{$countries_list}</select>
            </div>
          {/if}

     

  6. Hello,

    In the back office go to : Localization >> Countries

    and click on right side button : "edit" for the country you want, here it's United States

    from there you have Address format ... Then Here you go ! 🙂
     

    firstname lastname
    company
    address1 address2
    city, State:name postcode
    Country:name
    phone
    phone_mobile

    change the line you want and order it as you like.

    • Like 2
  7. IF I understand you good, you have problem on CSV products import but for updating products categorie default only ?

    here is the piece of code that I think is doing the thing from AdminImportController.php file :

    
            // Will update default category if there is none set here. Home if no category at all.
            if (!isset($product->id_category_default) || !$product->id_category_default) {
                // this if will avoid ereasing default category if category column is not present in the CSV file (or ignored)
                if (isset($product->id_category[0])) {
                    $product->id_category_default = (int) $product->id_category[0];
                } else {
                    $defaultProductShop = new Shop($product->id_shop_default);
                    $product->id_category_default = Category::getRootCategory(null, Validate::isLoadedObject($defaultProductShop) ? $defaultProductShop : null)->id;
                }
            }

    That means If the product has already a default category assigned, the new import csv will not erase it and keep it, while adding news categories to the product settings.

     

    PS: Note that ID cat '1' is Root and Home is '2', so if you want products assign to home use ID 2 instead of 1.

  8. Hello,

    here is the beta version of a new module for homepage, based on default TB home page slider, so you'll find the place to upload images and configuration in the BO like the other one but this one use Jquery VEGAS SlideSHOW

    https://vegas.jaysalvat.com/

    This is first version, it needs improvement to add more options and being able to choose the place where to show it, it can be real background slides or just a FULL screen, or full minus header, etc..

    Please give comments if you have some .

     

     

    vegasslider.zip

    • Like 1
  9. just to do it fast, you can change the old content of  "/js/jquery/plugins/jqzoom/jquery.jqzoom.js" by this one here :

    https://raw.githubusercontent.com/jackmoore/zoom/master/jquery.zoom.min.js

    infos here : https://raw.githubusercontent.com/jackmoore/zoom/

    no need of the css file anymore in the jqzoom directory..

    it works instantly 🙂

     

    Later I'll try to dig into that on github and fix that properly.

     

    • Like 1
  10. In order to be move your logo position, you'll need to understand the bootstrap structure at first and modify the smarty themes files .tpl.

    header.tpl is the place where your logo is loaded.. but what do you want to do exactly ?

     

    For the block languages & block top menu, you can  try to modify the position of the hooks for theses modules, if that does not work as you wish you'll need to modify tpl files and css files maybe as well, that needs understanding of the whole process to not break responsiveness of the theme

  11. Hello,

    you can add something like this in your product.tpl file in theme folder :

     

                {if $product_manufacturer->id}
                    <img src="{$img_manu_dir}{$product_manufacturer->id}-medium_default.jpg" class="logo_manufacturer img-responsive" title="{$product_manufacturer->name}" alt="{$product_manufacturer->name}" />
                {/if}

     

    • Like 1
×
×
  • Create New...