Post by azzi-charbel » Tue Sep 15, 2020 5:25 pm

Hi,

I have been searching for days all over the internet for a solution and yet nothing found ! It is very weird their is no solution, workaround or a fix for such very important feature in Opencart system.

I am on OpenCart 3.0.3.6 and all what I am trying to do is create an order from admin side on behalf of a customer... this is a must for my store as we take order by phone.

Steps:
1) Go to: Admin > Orders > Insert (+)
2) Choose a customer, then click continue.
3) Choose any product and click on " +Add Product"
4) The products are not being added on to the table even if repeated the same step 1000 times and the weird is that there are no errors are being logged, no error are displayed on the screen.

The only error I could find is the below:
_ In Firefox Inspector under "Console" tab.

Code: Select all

Cookie “__cfduid” will be soon treated as cross-site cookie against “https://examle.com/admin/index.php?route=catalog/product/autocomplete&user_token=kjkjsdsakdakjsdjashdasdas&filter_name=” because the scheme does not match. index.php
Cookie “__cfduid” will be soon treated as cross-site cookie against “https://example.com/index.php?route=api/cart/add&api_token=kjkjsdsakdakjsdjashdasdas&store_id=0” because the scheme does not match. index.php
Cookie “__cfduid” will be soon treated as cross-site cookie against “https://example.com/index.php?route=api/cart/products&api_token=kjkjsdsakdakjsdjashdasdas&store_id=0” because the scheme does not match.
What should I do ? isthere a fix somewhere ? a patch ? code modifications ?

Below are 3 different topics explain same problem with no clear answer: Thank you,
Last edited by azzi-charbel on Wed Sep 16, 2020 12:25 am, edited 1 time in total.

Newbie

Posts

Joined
Wed Nov 06, 2019 8:30 pm

Post by sw!tch » Tue Sep 15, 2020 6:10 pm

When trying to add a product - Have Google Chrome inspector open and check your console log for errors.

Backup and [ learn how to recover ] before you make any changes.


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by azzi-charbel » Tue Sep 15, 2020 6:30 pm

After adding a product:
The "console" tab is showing no errors but the "Network" tab is showing an error as per attahed images.

Thank you,

Attachments

Network Error.JPG

Network Error.JPG (88.04 KiB) Viewed 372 times

Console Error.JPG

Console Error.JPG (54.34 KiB) Viewed 372 times


Newbie

Posts

Joined
Wed Nov 06, 2019 8:30 pm

Post by azzi-charbel » Wed Sep 16, 2020 4:56 pm

No any help here !
I believe this is a common problem...

Newbie

Posts

Joined
Wed Nov 06, 2019 8:30 pm

Post by letxobnav » Wed Sep 16, 2020 5:24 pm

in network (as in the first image), you have 2 lines, click one, select preview on the right and show what that request returns.
Do the same with the second line.

The first line preview should show the add result, the second the list of products in the cart.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by azzi-charbel » Wed Sep 16, 2020 5:56 pm

I tried to add a product while the netword tab is open and then took below screenshots (first line.JPG and Second Line.JPG) as as requested !

I also noticed, as explained in Checkboxes.JPG image, if one or both checkboxes are checked, both lines will disappear.

Thank you,

Attachments

Second Line.JPG

Second Line.JPG (54.42 KiB) Viewed 267 times

first line.JPG

first line.JPG (43.66 KiB) Viewed 267 times

Checkboxes.JPG

Checkboxes.JPG (53.71 KiB) Viewed 267 times


Newbie

Posts

Joined
Wed Nov 06, 2019 8:30 pm

Post by letxobnav » Wed Sep 16, 2020 6:05 pm

click first line, select headers on the right, scroll down to form data to see what post variables are send.
also check in your table cart if there is an entry for the product you just added and api_id > 0
could be a language_id problem.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by azzi-charbel » Wed Sep 16, 2020 6:39 pm

For the first line under "Headers" Tab:

Code: Select all

[b]General:[/b]
Request URL: https://example.com/index.php?route=api/cart/add&api_token=asdasdsadsadasdsadsad&store_id=0
Request Method: POST
Status Code: 200 
Remote Address: 104.27.177.140:443
Referrer Policy: no-referrer-when-downgrade

[b]Response Headers:[/b]
cf-cache-status: DYNAMIC
cf-ray: 5d39ea5fbd8a1037-MRS
cf-request-id: 053810cfd700001037fb0cc200000001
content-encoding: br
content-type: application/json
date: Wed, 16 Sep 2020 10:31:03 GMT
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
status: 200
vary: Accept-Encoding,User-Agent

[b]Request Headers:[/b]
:authority: example.com
:method: POST
:path: /index.php?route=api/cart/add&api_token=asdasdsadsadasdsadsad&store_id=0
:scheme: https
accept: application/json, text/javascript, */*; q=0.01
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9,ar;q=0.8,fi;q=0.7,mt;q=0.6
content-length: 25
content-type: application/x-www-form-urlencoded; charset=UTF-8
cookie: __cfduid=de1c2df065a228ee309cb942f1b82686e1600165374; OCSESSID=ef07b0da92dcc92df50b529e93; language=en-gb; currency=USD
dnt: 1
origin: https://example.com
referer: https://example.com/admin/index.php?route=sale/order/add&user_token=gdfghfdyvjhfgvjfgjgfdycrfvfhdfdfgfbhvfghd
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: same-origin
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36

[b]Query String Parameters:[/b]
route: api/cart/add
api_token: asdasdsadsadasdsadsad
store_id: 0

[b]Form Data:[/b]
product_id: 378
quantity: 1
Thank you for your help,

Newbie

Posts

Joined
Wed Nov 06, 2019 8:30 pm

Post by letxobnav » Wed Sep 16, 2020 6:44 pm

see, it does add the product, I bet it is also in the cart, it just does not retrieve the info after that.

since you can select a product from the autocomplete, it cannot be a language issue, I am beginning to suspect a cache issue, either on your server or via cloudflare.
Last edited by letxobnav on Wed Sep 16, 2020 6:55 pm, edited 1 time in total.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by sw!tch » Wed Sep 16, 2020 6:45 pm

Are you using Web Application Firewall Rules with Cloudflare or the free plan?

As @letxobnav mentioned - Maybe try the cache fix see if that's related, I can't duplicate this on 3.0.3.6. - viewtopic.php?f=201&t=207498#p737358

If that doesn't work - Try putting cloudflare in developer mode for a quick test see if works then. https://support.cloudflare.com/hc/en-us ... /200168246

Backup and [ learn how to recover ] before you make any changes.


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by azzi-charbel » Wed Sep 16, 2020 8:42 pm

Thank you @letxobnav and @sw!tch for your kind help, much appreciated !

I have finally found the solution to fix my problem which it was generated due to caches.

First of all, I am using Cloudflare free plan so first thing first I did is to turn on the development mode in Cloudflare and purge all caches but yet the error still exists.
Secondly, I have tried to pause Cloudflare process for my site but yet the problem persists.
Thirdly, I have turned on again Caches in Cloudflare and turned Off the development mode then went to Cpanel > Cache Manager > Options tab > Set the Enable Caching to No.

And finally the error has gone for good and now I can create/edit orders and add/update products without issues.

So the real problem was coming from my caching server.

Thank you all for your kind help,

Newbie

Posts

Joined
Wed Nov 06, 2019 8:30 pm

Post by letxobnav » Wed Sep 16, 2020 11:15 pm

good.
The cloudflare headers already indicated it as DYNAMIC so they would not cache it.

There is also a cpanel cache manager?
This caching pandemic is getting out of control.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by azzi-charbel » Thu Sep 17, 2020 12:25 am

Yes even on my VPS Host, I still have a cPanel Manager and believe me lots of my errors ended up by disabling this caching manager

Newbie

Posts

Joined
Wed Nov 06, 2019 8:30 pm
Who is online

Users browsing this forum: No registered users and 22 guests