Jump to content
thirty bees forum

datakick

Administrators
  • Posts

    3,116
  • Joined

  • Last visited

  • Days Won

    485

Posts posted by datakick

  1. I've added the option to set columns as hidden by default. When you create list column, you can pass 'hidden' => true, and thirtybees will not show it by default. Here's example:

    https://github.com/thirtybees/thirtybees/blob/f27320165d9e788af9f702af547adaaed6e0db90/controllers/admin/AdminOrdersController.php#L179

    Once we implement list column customization, we will be able to show those default hidden columns, hide columns that are displayed by default, or even reorder columns in the list.

    • Like 2
  2. Yeah, that's unfortunate. It's because there is actually no type column in product table. Product type is determined on thy fly from other product properties. For pack, there must be pack items in pack table.

    So, you have to switch to 'Pack combination' type AND then, before you save product, go to Combination tab and assign pack content to at least one combination. That will lock it in

  3. Thanks everyone for testing. I've created the issues for those problems, and will make sure they are addressed before we merge this into bleeding edge.

    As we found out, the solution we implemented before was not good enough for all use cases. The virtual/dynamic attributes are fine in most cases, but sometimes we need even more flexibility. So we implemented yet another enhancement in this area -- full-fledged packs per combination.

    You can now choose between two different versions of packs 

    • Pack of existing products -- original implementation, when pack is defined on product lavel. You can use virtual/dynamic attributes here to tweak pack content using dynamic product attributes, as described in this thread above
    • Pack of existing products - combinations -- new functionality. When you select this, you won't be able to define pack on product level, but you will have to define packs for every combination separately. This gives you great flexibility, as your combinations can have totally different/independent pack items. But obviously, it will be more complicated to set up, as you need to define pack content for every and each combinations. So choose this only when appropriate

    image.thumb.png.549ca55f5a7d97f5fcba08b9b6c3217e.png 

     

    Pack content on combination level:

    image.thumb.png.947c5178de7dac0f6b655cc30ab8ae88.png

    This new functionality is in pack-combinations branch.

    If you can, please help us with testing once again. 

     

    • Like 1
  4. Thanks for testing

    14 hours ago, wakabayashi said:

    I am now playing around with this... What is the technique behind it, where are the filter values saved? In cookies? 

    Yes, so far the values are saved in cookies. However, there is now an abstraction (ListViewStorage interface) that will make it possible to save filter values differently in the future. It's a todo task that I would like to implement soon. With this in place, cookies will be much smaller, and we will be able to implement additional features like saved filter presets. I think that will make this quite useful

    14 hours ago, wakabayashi said:

    With a pretty basic list of my module, it seems to work fine. With a very complex list, I get the following...

    Thanks for bug report. I believe I have fixed this - could you please re-test on latest version of this branch? If you still get the error, please send me a controller class, so I can figure out what is wrong.

    • Thanks 1
  5. 22 minutes ago, insecta said:

    I see that the coreupdater it's not compatible with php 5.6 because it use ?? (coalesce), that it's not supported, but I can't upgrade php for the errors, so I'm in a loop

    I've just released a new version 1.6.12 of coreupdater that should fix this php5.6 compatibility issue.

  6. 1 hour ago, musicmaster said:

    Here is the discussion on the Smarty Github: https://github.com/smarty-php/smarty/discussions/967

    Thanks, interesting read.

    At least for smarty v5 there is a dirty fix available that will not require much work. That's good to know.

    Unfortunately this fix is not available for smarty 4.4.x, so we will have to skip those and update straight to smarty v5. And there are many breaking changes related to that update, so it won't be doing that anytime soon.

  7. 1 minute ago, Yabber said:

    On github I saw that to smarty version 4.5.5 developer from prestashop added support for PHP 8.4
    https://github.com/smarty-php/smarty/releases

    Unfortunately it won't be easy to upgrade smarty to newer versions easily.

    New versions of smarty raises a lot of new deprecation warnings when templates call php methods directly. We are now required to register all methods that are allowed to be called from smarty template. As you can imagine, that's something absolutely impossible for system like thirtybees/prestashop -- we simply don't have that information.

    For example, if some module template contains code like this:

    {if Configuration::get('PS_INVOICE')}
    	<span>...</span>
    {/if}

    we would have to tell smarty engine that the method Configuration::get exists and can be called.  

    In the near future, using that template without registering the method would cause runtime error.

    Because we are using templates from third party modules and themes, we simply don't know what methods are used. The only potential solution for us is to parse templates to collect list of all used methods so we could register them before template is used.

    While the parsing can be done only once (when template source changes), the registration of methods needs to be done on every render. That will cause quite a big performance impact - we need to load the info from somewhere and pass it to smarty engine.

    I don't understand why this change has been introduced, and I'm very unhappy about that. 

    We will either have to keep using smarty 4.4.1 forever (which is not possible due to new php versions not supporting it).

    Or we will have to invest days or weeks of work to implement that stupid registration, just to get to the same point we are now.

    • Like 1
    • Sad 1
  8. The core is not yet php8.4 ready. We already fixes few issues, but there are still some to iron out.

    There is nothing braking, though - just a lot of new deprecation warnings, mostly related to "Implicitly nullable parameter types". PHP8.4 now complains when parameter with default null value is not marked so. All methods and function that look like

    public function func(string $test = null)

    must now have slightly different signature:

    public function func(?string $test = null)

    It's fairy easy to fix these warnings. There are even an automated scripts to do that across entire codebase. But obviously, we can't fix third party modules.

    I'm also a little bit worried about method overrides. I'm not sure how well PHP will take if the overridden method has slightly different signature. 

    • Thanks 1
  9. 7 hours ago, the.rampage.rado said:

    @datakick,

    I have two more questions.

    1. In the module we have 'Auto generate' button. What is it's functionality and how it decides which suppliers need an order?

    This functionality is based on Products to Order overview. 

    That table shows list of all supplier products and calculates safety stock/reorder point for each supplier. To calculate this, it takes into account your sales history, supplier lead time, stock keeping costs, and some other factors.

    You can check that table to figure out when you should order product from that particular supplier. For every supplier, the reorder point for that product can be different:

    image.thumb.png.abb9664992775fe533b297cd3b68bd5b.png

     

    Now, the Auto generate button is very simple.

    It looks into this table, but only for suppliers that are set as product default supplier. It current stock is below reorder point, the empty/blank/draft purchase order for that supplier is created. No product is added. It just exists so the back office employees knows what to check.

    It's not perfect, and it's not for everyone, but it can help keep an eye on things.

     

    7 hours ago, the.rampage.rado said:


    2. Do we consider the best price for certain items when offering them for supply order? Let's say I have 3 suppliers A, B and C. They offer nearly the same range of products but prices might differ quite substantially (more than 5%, up to 30% on some items). We of course would like to order some items from the best possible place and some items that have the same (or nearly the same) price might be ordered from every supplier. 
     

    No, the module currently does not do that. It's a good suggestion, I've added this enhancement request to the backlog.

    We already have a similar ER to warn when the product is in another PO (draft or sent).

     

  10. Well, this is more complicated.

    To accomplish this, you will first need to slightly amend the code of the module. 

    Edit file /modules/datakick/engine/prestashop/schema/combination.php

    find section 'fields' -- it begin with this code like this (depending on module version it might be slightly different):

                    'fields' => [
                        'id' => [
                            'type' => 'number',
                            'description' => 'id',
                            'selectRecord' => 'combinations',
                            'mapping' => [
                                'pa' => 'id_product_attribute',
                                'pas' => 'id_product_attribute',
                                'sa' => 'id_product_attribute'
                            ],
                            'update' => false
                        ],

    and inside this section add new field:

                        'hasImages' => [
                            'type' => 'boolean',
                            'description' => 'Has associated images',
                            'update' => false,
                            'sql' => 'EXISTS(SELECT 1 FROM ' . _DB_PREFIX_ . 'product_attribute_image AS pai WHERE pai.id_product_attribute = pa.id_product_attribute)',
                            'require' => ['pa']
                        ],

    After you save it, you will be able to use this new field in datakick module. You can use it in condition. Edit conditions for <entry> node:

    image.png.269ad9a46889bb17aabbeb3455190bac.png

    This way, you can have a section that display only combinations that have explicitly associated images.

    In this section, we want to display only images associated with combination. So edit <g:additional_image_link> node, and use 'Restriction = Combination images'

    Next step is to duplicate entire <entry type="variant"> node, but this time use condition Combinations: Has associated images is No

    This new section will display only combinations without explicitly associated images.

    In this section, we want to show all product images. So you should edit <g:additional_image_link> node and use

     

    • Restriction = All data (all images)
    • add custom Condition (combination.productId == image.productId) to filter out images that belongs to other products

     

    At the end, you will have three <entry> nodes at the top level nodes of your template, it should look like this (I've removed the children nodes of <entry> nodes):

    image.png.7d919794cb45f550b5caf96d16af7ba0.png

     

  11. For combinations, it almost the same:

    add new node, with data = Images, restriction = Combinations images

    image.png.d6cd2943de4d469fb304b42855929f41.png

    Content of the node should be expression productImage(image.id, image.friendlyUrl)

    Result:

     

    image.png.3e165dcb5ae361dd13aa50e5ef6d83ae.png

     

    Note: this will display only images that are associated with given combination. Make sure you have images associated with combinations (Edit product > Edit combination > associate images).

    Alternative, if you want to display all products images (not only those associated with specific combination), you can modify the node this way:

    • Restriction = All data (all images)
    • add custom Condition (combination.productId == image.productId) to filter out images that belongs to other products

    image.png.b379143e5c0dbf1f39d462470ce0683b.png

     

  12. I appologise for the late reply, I missed this request.

    There's no need for any postprocessing as @Adik suggested in his reply. Datakick module supports building this out of the box. Let me explain how xml builder works.

    When you create xml node, you can assign it Data property. When you do that, that node will be repeated for every record in your database.

    Example: node <category> assigned data = Categories.

    image.png.55a673859eb881af75a956940a5be07d.png

    Result: category node is repeated for every category in your sotre.

    image.png.5ad11996d174286123f0b2d5812928d6.png

     

    Now, inside this <category> node, you can create a new node, and once again assign it Data property. For example, product:

     

    image.png.e7cda83577458dcc792dc72793160f25.png

    Result - inside every category, all products are displayed

    image.png.2617a87d5f8f20e1243ab6d45dd3a3cd.png

     

    That is probably not what you want, though. You probably want to filter out products that are somehow relevant to the parent category. For that, there is a Restriction property. You can say how to restrict product based on their relationships with parent node (category). For example, we can have 'Products in category' restriction which means that product is assigned that category. Or you can use 'Product use category as default' restriction.

     

    image.png.485e08cfb79c9879b746ca1c61a18975.png

     

    Result : we have list of all categories containing only products associated with that category

    image.png.0020756a046d1c23de00355fe40d3c0f.png

     

    Back to the question. In the same way, we can modify xml feed for google, and add new element <g:additional_image_link>, assign it with Image data, and set restriction = Product images. We can also add additional condition to get rid of remove default image that is inside <g:image_link>

     

    image.thumb.png.a6414cc670ec7813d44497963278216b.png

     

    Result is what we want:

    image.thumb.png.5e8cea6ae0a4a0e1bf56c49a86edaf1d.png

     

     

    • Like 1
  13. 33 minutes ago, Scully said:

    Would it be possible to execute the trigger from server side directly via cron?

    With some custom modifications/overrides it's possible.

    Easier solution is to go to Preferences > SEO & URLs , click on Add new Page, and define friendly url for this controller.

    image.png.246ac7d574e4b5d7870375237abaf758.png

    With this in place, your store will use friendly url for this controller instead of direct php call:

    image.png.4d2c11a6e3689e29b3571ae4c491c4c9.png

     

  14. I did some testing, and... released a new version of paypal module, and I strongly recommend everybody to update 🙂

    There was a serious bug in module. When creating an order, paypal module provided current cart value instead of amount that was actually paid. This should be always the same, unless it isn't.

    For example, if you can do this:

    1. clicks on payment button that opens paypal checkout page
    2. open your store in different tab, and amend the cart (add/remove products, change carrier,...)
    3. switch back to paypal tab, and conclude the payment

    Normally, the order would be created with Payment Error state. But because of the bug in paypal module, the order would be created in Payment validated state, everything marked as fully paid. Neat.

     

    • Like 2
    • Thanks 2
  15. 21 hours ago, DRMasterChief said:

    Interesting possibility, I don't have a use for it that I can think of yet, but as always, thanks for your work and i will test it!

    There are a lot of use cases, but I guess it depends on what needs you have. For example, we have recently used this feature to find all products within certain profit margin range. 

  16. For developers here:

    you can test adding your own filter fields by modifying Admin***Controller classes, using new property filters_list. This property accepts the fields in the same format as property fields_list (which is used to define list columns)

    Example from AdminOrdersController:

    This is all that is needed to support filtering on customer email and names:

    https://github.com/thirtybees/thirtybees/blob/f59054511624de2131f86e4373604f827362468e/controllers/admin/AdminOrdersController.php#L214-L230

            $this->filters_list = [
                'customer_email' => [
                    'title' => $this->l('Customer - Email'),
                    'type' => 'text',
                    'filter_key' => 'c!email'
                ],
                'customer_first_name' => [
                    'title' => $this->l('Customer - First Name'),
                    'type' => 'text',
                    'filter_key' => 'c!firstname'
                ],
                'customer_last_name' => [
                    'title' => $this->l('Customer - Last Name'),
                    'type' => 'text',
                    'filter_key' => 'c!lastname'
                ],
            ];

     

     

  17. Hello everyone,

    I'd like to announce new upcoming feature, and as always ask for testing and reporting any and all issues, problems, and enhancement requests.

    This new functionality is names List Filters. You can test it by upgrading your store to list-filters branch (using core updater in custom targets)

    image.png.6694e2b33ba598305e7d930de8a45313.png

    What this new functionality do?

    On every (filterable) lists in back office you will find a new icon in upper right corner:

    image.png.8e3706a5be43b083ade94c9141583e19.png

    When you click on it, new section will appear. Here, you can define additional filters that will be applied to the list.

    image.thumb.png.b210c45fa90d3d03a342dba0055c2f10.png

    The new filters are applied together with the standard filters from list header.

    But these new filters are slightly more powerful, because you can select operator - not, contains, starts with, between, any of

    Also, developers can define additional filters in AdminControllers that do not depend on list columns. For example, I have added new filter fields for Order list controller - (Customer - Email, Customer - First Name, Customer - Last Name). So you can filter order list by customer email, even though customer email is non one of list columns!

    We will be slowly adding more and more filter fields based on your suggestions. Let us know what you need!.

    This functionality is not 100% completed, but it's quite stable. I've been using it on few production servers without any issues for a few weeks now, so it should be safe for you to test it as well.

    We already have a few enhancement we want to implement. One of them is support for filter presets -- you will be able to save your filter settings, and easily switch between different presets. 

    Now it's your turn. Please test and give feedback. I'm sure there is a lot to improve here.

    I'm very excited about this new feature, as I wanted to do have this for a few years now. And finally it's coming 🙂

     

    • Like 7
  18. The Edit button on that page is "special" 🙂

    When you click on it, it simply changes the content of New Tax Rule form. If you are way down the list of countries, you may not notice this.

    image.thumb.png.c6a268c0c246270feaa528a95c80be5b.png

×
×
  • Create New...