Jump to content

 

harmsmitsdev

Member Since 22 Feb 2020
Offline Last Active Yesterday, 09:01 PM
-----

#338923 We Must Be Visible For Shipping Platforms Companies! +Community

Posted by harmsmitsdev on 02 May 2021 - 10:32 AM

Yeah, it will be perfect for european users, let us if you decide make it open source,  it is the right thing to support these services and not have to implement them separately :D

Well, we have had quite a fair share of issues with sendcloud so far. Most boils down to unreliable package statuses, but that is just DPD iirc. Furthermore, you should also beware of these services since they will vendor lock you. If you create a SendCloud account, and register your business, you will *NOT* be able to get a separate quote from the direct partners. So if I have a SendCloud contract, I can not get a contract (after I close it) with DPD. So you might be missing out on some really good prices.




#338900 We Must Be Visible For Shipping Platforms Companies! +Community

Posted by harmsmitsdev on 30 April 2021 - 11:26 AM

I already have an integration for Sendcloud, works like a charm. They were not interested though ¯\_(ツ)_/¯

 

For those interested, it synchronizes orders and is able to receive status updates through a set wehook. It queues all traffic so no slow store or anything like that. Only downside, but also upside, is that it has PHP 7.4+ as a requirement.

 

Wouldn't mind opensourcing btw, but it will need some adjustments before I do that, as it is now made just for our own private use really.




#338838 Var Folder

Posted by harmsmitsdev on 28 April 2021 - 07:19 AM

I tried copying everything I could find in the latest CS-Cart update version into the new var folder and have reinstalled all our add-ons.

 

I shall try and copy the contents of the design folder as per your instructions. Thanks for that!

 

Are there any other files or folders in the /var folder that are essential for the shop to operate? Because it kinda seemed to work (with a few little bugs of course) even with the var folder being completely absent.

 

 

 

That was the first thing we tried, but for some reason, the daily updates stopped a while back.

Great, that should do the trick, although, like mentioned before, your files (/var/files) can not be restored.

 

Next time though, make sure the set the permissions of e.g. all non-cache files to something *other* than the webserver. This way, if your admin has only basic privileges by default, he will not be able to delete the actual directory.

 

Nonetheless, just use `?cc&ctpl` next time, it does quite literally the same thing.




#338783 Can you override controllers ?

Posted by harmsmitsdev on 26 April 2021 - 10:18 AM

 

Please Help... icon_sad.gif
I want to override checkout and product controller with my user defined functions.

 

**very** late answer, but yes you can.

 

You can use the 'dispatch_assign_template' hook. Use a function as follows (object oriented style):

public function onDispatchAssignTemplate(
    string $controller, string $mode, string $area, array &$controllers_cascade
): void {
    if (!SiteArea::isStorefront($area) || $controller !== 'categories' || $mode !== 'view') {
        return;
    }

    $default_controller_path  = DIR_ROOT . '/app/controllers/frontend/categories.php';
    $override_controller_path = DIR_ROOT . '/app/addons/my_addon/controllers/frontend/categories.post.php';

    $controllers_cascade = array_filter(
        $controllers_cascade,
        static function ($item) use ($override_controller_path) {
            return $override_controller_path !== $item;
        }
    );

    array_walk(
        $controllers_cascade,
        static function (string &$controller_path) use ($default_controller_path, $override_controller_path): void {
            if ($controller_path === $default_controller_path) {
                $controller_path = $override_controller_path;
            }
        }
    );
}

This will replace the controller `categories.post.php` from the addon `my_addon` when the dispatch equals `categories.view`.




#338405 A New, Interesting Feature For 4.13

Posted by harmsmitsdev on 12 April 2021 - 07:32 AM

Since end of 2020, I have been working on bringing some new features to CS-Cart myself. One of the things every developer should know of, which can greatly help, is `multiquery`. MultiQuery is a concept where one can send multiple queries in one go to the database.

 

Why should you use multi query? Well, in some *larger* environments, there simply is a round robin time for queries, which can easily be as high as ~.5ms. Now, Cs-Cart by default requires about 60 queries for a normal page. A product page will take up a hundred or so. MultiQuery offers a partial solution in this case, where it will allow you to send multiple queries at once to the database.

 

Its really easy to use, and only requires people to have defined the 'Mysqli' backend for their database (NOT PDO). Over the next few months, I will need to spot some areas where these things can be used, but one that you will immediately see is in `fn.images.php`; Usage is as follows:

list($query1, $query2) = db_multi_query([
    [
        MultiQueryTypes::ARR,
        'SELECT * FROM ?:products LIMIT 5',
    ],
    [
        MultiQueryTypes::HASH,
        'order_id',
        'SELECT * FROM ?:orders LIMIT 5',
    ],
]);

`\Tygh\Enum\MultiQuerTypes` holds all available types of querying in CsCart, think about `db_get_row`, `db_get_field`, `db_get_fields`, `db_get_array`, etc. The `db_multi_query` function will keep its array indices, meaning you could also directly assign it to the view controller with predifined offsets if you really want.

 

You can dynamically construct the array to bundle a lot of common queries if you prefer. But please mind, this is no excuse for bad queries. There are simply scenarios where one will require a variety of queries, since a UNION won't work, and that is what this is intended for.

 

In 4.14 I might add 'async' functions (if time permits) for this as well, where it will execute a stack of queued functions once a result is resolved, or when a blocking query is executed. This should greatly help to get some better performance for environments with high round robin times, especially since you can lift on queries CS-Cart already sends.

 

Anyways, I thought I'd bring this to your attention since most of this stuff never makes it into the release log.
 




#336149 Adyen Payment Gateway

Posted by harmsmitsdev on 03 February 2021 - 08:20 AM

Curious to hear why you think Adyen is shit? :)

Random API outages (without any reporting), bad SDK's available, no developer support. It makes it a nightmare to integrate and maintain. Besides that, the sales representatives are complete bullshit. Communication takes ~2 days to respond to a simple inquiry, for an essential part of someone's business that is just way too long.

 

On the other hand, Pay.nl has always responded to us within 15 minutes or so. They report outages directly to us (although they have not had one in a very long time), and keep us unformed when e.g. the api changes.




#335835 Dissatisfaction With Bug Tracker Response Times

Posted by harmsmitsdev on 26 January 2021 - 06:04 PM

You all don't get it, new features and more features is the priority for cs-cart. Their mentality revolves around more and more bells and whistles so they can say our cart is capable of 1,2,3 and a.b.c and also x.y.z. Quality of product, good design decisions is not something they are interested in, and classic example is lite checkout. They tried to reinvent something as critical as checkout and messed it up big time. I am still running old checkout.  

Or really really maybe because writing a proper checkout is just hard and people don't report anything during the *beta* releases of these things. Who ever looks at dev.demo.cs-cart.com and checks if there is an issue or not with the checkout when they update it? They have asked for your thoughts many times already but no-one bothers to check it out, which is a shame really.

 

Of course both are to blame, but not like this. *YOU* want to upgrade without blinking. At least test it before you put it live, backup your database, etc. This is a *completely normal procedure* for any company that updates their software. No company thinks on a friday evening, 'hmm let me just update my main source of income because it got release yesterday'.

 

Nonetheless, CsCart should test their software more, especially with regards to things like order calculation. But the fact remains they can not account for *every* single variable. Even when using fuzzing or something, they will not iron out every bug you might encounter, as it is simply impossible with all variables that you have to account for.




#335688 Dissatisfaction With Bug Tracker Response Times

Posted by harmsmitsdev on 21 January 2021 - 10:08 PM

It is one of cs-cart's shortcomings.  They will pay attention if you make a report against the most recently released version (maybe - new features get higher attention because they are more fun to work on).  But if you report an issue that is for any prior release, it can take months.  Cs-cart is not effective in evaluating newly reported defects to even get to confirmed/unconfirmed in a reasonable period of time.  The only solution is to contact helpdesk. But then the answer may be that "it will be fixed in a future release or looked at in 45 days".

 

This has been "normal" for the more than 10 years I've been working with cs-cart.

 

Good luck.

Then you should also know that as a developer you can submit patches for bugs.




#335028 Adding A New Banner Template

Posted by harmsmitsdev on 30 December 2020 - 09:20 PM

It is `block_manager` not `block-manager`. Besides that, you should also clear your cache after changing those files or enable development mode and disable block caching.

app/addons/addon_name/schemas/block_manager/blocks.post.tpl

Furthermore, your schema should look as follows:

<?php

$schema['banners']['templates']['addons/addon_name/blocks/addon_name.tpl'] = array();

return $schema;

 




#334029 Module: Utm Statistics

Posted by harmsmitsdev on 03 December 2020 - 12:37 PM

why we need this ? google analytic cant do that ?

Because ad blockers exist.




#333155 Dockerizing

Posted by harmsmitsdev on 04 November 2020 - 09:00 AM

Great, thanks. 

 

That makes sense.   So you run the command line migrations on production prior to pulling in code changes?  I didn't realise you could run the database migrations separate to the code updates. 

 

The reason I wanted to use S3 was that we have custom addons, one of which is for our product brochures.  All brochures have 1 page, but in special circumstances, some products have a second page with more detailed product specs on them.  If a file is found in a particular folder that matches the product SKU, then this second page is appended to the PDF.  The reason I wanted to use volumes was so that management could FTP directly into the folder and drop the second page PDF files as they were generated...   But I gather the same would work for EFS.... 

 

How about deployment, do you use ECS for your containers?

 

I am trying to think of the simplest deploy method to aws.   Traffic to our site is about 20K users per month with session times of about 4 minutes which is pretty modest.   I keep thinking of dockerizing and using ECS, but maybe that is overkill. 

 

Currently i run mysql on the same instance as the website.  Although I think it makes sense to possibly push the database to its own VPC..  

 

I would be interested in your thoughts.... thanks again

For deployment we use EKS and ECS. It depends on the needs one customer might have. Kubernetes works amazing for websites that only need 3 or 4 application servers, whilst something like ecs is generally more robust and is used along with amazon rds & elasticache to build a store able to withstand the traffic of a few thousand sessions at once.

 

Besides that, kubernetes also works way better for cross-cloud. As you can easily take your business to azure / google cloud within a few hours. Which is something that a lot of customers also prefer.

 

Regarding the simplets method to deploy to aws. Just create an aurora database (serverless), with elasticache, and install cscart on a single server. If time comes for autoscaling, its not even that hard to set up at that point. As you will just need to create a docker container for your application and register it accordingly.




#332821 Images Change Variation Products

Posted by harmsmitsdev on 26 October 2020 - 08:29 AM

hi i have a product created with variation so its now 150 products different sizes and colors

see screenshot

 

how to change de color shirt in 1 time for a color

i tryed to select all sport grey and then change image all but then it change also for the rest of the products in the variation even the ones not selected

 

to do all 1 by 1 wil take alot of time when you have then 50000+ products

 

hope you have a eazy way to do this

This is a known bug in CS-Cart, will be fixed in 4.12




#332613 Sql Injection Vulnerability In Alexbranding `product Of The Day`

Posted by harmsmitsdev on 19 October 2020 - 12:44 PM

Hello,

 

About one and a half week ago, an SQL injection vulnerability located in the `Product of the Day` add-on caught my attention. Since then, the according changes have been made to the `Product of the Day` add-on from AlexBranding. Therefore, it is of the utmost importance that you update the `Product of the Day` addon.

 

My research has shown that this vulnerability has been present since at least version 1.4, therefore all those affected are urged to either disable/update the addon or contact AlexBranding at the earliest convenience.

 

Exploit details and research will be published later next month to give all those affected a fair chance at patching their vulnerable software.

 

Kind regards,




#332506 Cs Cart Support For Php 7.3 & 7.4

Posted by harmsmitsdev on 15 October 2020 - 07:34 AM

Has 7.4 now got offical support from cs-cart? I see there are compatability changes in 4.11.5 for php 7.4 - but I cant find any documentation on IF its officially supported and if so, what modules we need to enable.

No its not, there are still a few changes that need to be done before 7.4 compatibility. Most likely 7.4 support will come with 4.12, but don't take my word for it.




#330589 Northskull Theme

Posted by harmsmitsdev on 17 August 2020 - 06:34 PM

This is custom theme created from scratch.

Well, not entirely, you are literally using all the javascript provided by CS-Cart. But then again, rewriting all the frontend javascript is quite a hassle. I have been busy on a project for a while now where we are reworking the entire for frontend to vanilla js, and performance is significantly better than using something like jQuery.