Jump to content

(!) Searching for products on Create order page


Tinox

Recommended Posts

Hi,

Setting up a new shop using 1.7.7.1.

When creating an order in backoffice as administrator, I can choose the customer, but none of the available products are retreived when searching for them the field "Search for product" in the "Cart" section. A blue box is shown stating [ (!) Searching for products. ]. This makes it impossible to create an order from the backoffice, an imperative task in this shop's scenario. Same for "Add a product" on the edit page of an excisting order.

Edit 1: when I search for non excisting string a red box is displayed: [ (!) No products found. ], so something's working in the background.

Edit 2: search paramaters page states: The "indexed" products have been analyzed by PrestaShop and will appear in the results of a front office search. Indexed products 14 / 14.
I also re-built the entire index, but that didn't help.

Thanks for reading and best wishes,
Tinox

Product search.jpg

Edited by Tinox
More info and screenshot added (see edit history)
Link to comment
Share on other sites

Check your browser console/network tab in the developere tools. There should be a XHR request - check its response, if there is an error you should be able to see the details here (maybe you need to activate debug mode before)

Link to comment
Share on other sites

Thanks for your response JBW!

This morning I found out that the issue is rrelated to an addon that overrides the /override/classes/tax/TaxCalculator class. This causes an error in the getTotalRate() function of this override, so the search does not work. I have contacted the developer of the addon and will update here later.

Link to comment
Share on other sites

  • 4 months later...
  • 2 months later...
57 minutes ago, jvicente1971 said:

I'm having exactly same issue and don't have that module...Please any ideas?

My ealiert post is still valid:

Check your browser console/network tab in the developer tools. There should be a XHR request - check its response, if there is an error you should be able to see the details here (maybe you need to activate debug mode before)

Link to comment
Share on other sites

Hello

I have this error on developer tools:

Oops... looks like an unexpected error occurred
Oops... looks like an unexpected error occurred

Type error: Argument 7 passed to PrestaShop\PrestaShop\Core\Domain\Product\QueryResult\ProductCombination::__construct() must be of the type string, null given, called in ......./src/Adapter/Product/QueryHandler/SearchProductsHandler.php on line 273

[Symfony\Component\Debug\Exception\FatalThrowableError 0]

Enable debug mode
Back to previous page
Learn more about debug mode arrow_right_alt

 

Link to comment
Share on other sites

  • 1 year later...

hallo

 

ich habe auch dieses problem

kann bei einer bestellung keine produkte mauell hinzfügen da er mir bei suche für ein prokukt nichts anzeigt,als wenn keine prodikte vorhanden währen.

 

prestashop 1.7.8.7

 

danke im voraus für eure hilfe

Screenshot (35).png

Link to comment
Share on other sites

  • 5 months later...
  • 5 months later...

replace this function in  /src/Adapter/Product/QueryHandler/SearchProductsHandler.php on line 273

 

private function getProductCombinations(

        Product $product,

        string $currencyIsoCode,

        int $computingPrecision,

        ?Order $order = null

    😞 array {

        $productCombinations = [];

        $combinations = $product->getAttributeCombinations();

 

        if (false !== $combinations) {

            foreach ($combinations as $combination) {

                $productAttributeId = (int) $combination['id_product_attribute'];

                if ( $combination['attribute_name'] == null) {

                    $attribute = '-';

                } else {

                    $attribute = $combination['attribute_name'];

                }

               

                if (isset($productCombinations[$productAttributeId])) {

                    $existingAttribute = $productCombinations[$productAttributeId]->getAttribute();

                    $attribute = $existingAttribute . ' - ' . $attribute;

                }

 

                $priceTaxExcluded = $this->getProductPriceForOrder((int) $product->id, $productAttributeId, false, $computingPrecision, $order);

                $priceTaxIncluded = $this->getProductPriceForOrder((int) $product->id, $productAttributeId, true, $computingPrecision, $order);

 

                $productCombination = new ProductCombination(

                    $productAttributeId,

                    $attribute,

                    $combination['quantity'],

                    $this->contextLocale->formatPrice($priceTaxExcluded, $currencyIsoCode),

                    $priceTaxExcluded,

                    $priceTaxIncluded,

                    $combination['location'],

                    $combination['reference']

                );

 

                $productCombinations[$productCombination->getAttributeCombinationId()] = $productCombination;

            }

        }

 

        return $productCombinations;

    }

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...