• Priority: 0
  • Status: Closed
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 23.03.21, 00:25
  • Opened by: Igor Kes
  • Closed by: Anonymous Submitter
  • Closed on:
  • Reason: Not a bug

Ticket #21116 - Stock display error

Hi,
we have an issue with displaying stock and dispatch time. Although we have stock available in product BO, on front it returns 0 stock.

An example:
https://dev.balticbhp.pl/snickers-6241-spodnie-robocze

In BO size 58 color blue available, in front it says 0.

Comments

Fred 23 Mar 2021, 11:38

sorry, but I don’t see the issue https://take.ms/apW1D

Igor Kes 23 Mar 2021, 12:17

Hi,
please have a look on attached screens. There is an issue with displaying variation informations. This is why template does not display stock corectly. You can see variable product on screen. When I change colors price is correctly changed but reference number and stock quantity is not. And on 3rd screen you see errors in google chrome console.

Attachments:

stock1.PNG (273.7 KiB)
stock2.PNG (446.8 KiB)
163646832_445918013130014_415... (481.8 KiB)
Fred 23 Mar 2021, 12:23

Did you add that yourself? because there is no such information in the theme by default

Igor Kes 23 Mar 2021, 12:32

No, this is data from theme as wel as it is default prestashop field:
Index/reference (numer produktu)
Number of items in stock & Availability date

And it seems not to work properly (they do not change when I change color of product).

Have a look below this is a part of original template code:

{block name=’product_reference’}

                  {if isset($product.reference_to_display)}
                      <div class="product-reference">
                          <label class="label">{l s='Reference' d='Shop.Theme.Catalog'} </label>
                          <span>{$product.reference_to_display}</span>
                      </div>
                  {/if}
              {/block}
              {block name='product_quantities'}
                  {if $product.show_quantities}
                      <div class="product-quantities">
                          <label class="label">{l s='In stock' d='Shop.Theme.Catalog'}</label>
                          <span data-stock="{$product.quantity}" data-allow-oosp="{$product.allow_oosp}">{$product.quantity} {$product.quantity_label}</span>
                      </div>
                  {/if}
              {/block}
              {block name='product_availability_date'}
                  {if $product.availability_date}
                      <div class="product-availability-date">
                          <label>{l s='Availability date:' d='Shop.Theme.Catalog'} </label>
                          <span>{$product.availability_date}</span>
                      </div>
                  {/if}
              {/block}
              {block name='product_out_of_stock'}
                  <div class="product-out-of-stock">
                      {hook h='actionProductOutOfStock' product=$product}
                  </div>
              {/block}
Fred 23 Mar 2021, 12:34

I understand that, but did you moved that code?
It only works in it’s own place.
you can test it out on Classic prestashop theme

Igor Kes 23 Mar 2021, 15:09

Ok, thank you. We have only this issue left. You can see it in attachement. This is an issue with picture slider on product page. Can you check and fix this issue? Thanks a lot.

Attachments:

163646832_445918013130014_415... (481.8 KiB)
Fred 23 Mar 2021, 17:16

I don’t see that error. How to cause it?

Igor Kes 23 Mar 2021, 22:26

Please enter for example this product https://dev.balticbhp.pl/snickers-spodnie-robocze-stretch-allroundwork-6341, and change color variation and then clic on ony photo in galery and then error in console will appear.

Attachments:

error.PNG (241.3 KiB)
Fred 24 Mar 2021, 11:48

The issue has been fixed. Please test to confirm the change

Igor Kes 24 Mar 2021, 11:58

Still the same issue when I change colours. For example this product: https://dev.balticbhp.pl/snickers-6241-spodnie-robocze

alysum.js:538 Uncaught TypeError: $(…).zoom is not a function

  at zoomperInit (alysum.js:538)
  at HTMLDivElement.<anonymous> (alysum.js:172)
  at Function.each (core.js:28)
  at e.fn.init.each (core.js:28)
  at HTMLDivElement.a (alysum.js:27)
  at Function.each (core.js:28)
  at e.fn.init.each (core.js:28)
  at MutationObserver.<anonymous> (alysum.js:27)

zoomperInit @ alysum.js:538
(anonymous) @ alysum.js:172
each @ core.js:28
each @ core.js:28
a @ alysum.js:27
each @ core.js:28
each @ core.js:28
(anonymous) @ alysum.js:27
childList (async)
(anonymous) @ core.js:39
$e @ core.js:39
replaceWith @ core.js:39
success @ core.js:261
u @ core.js:39
fireWith @ core.js:39
S @ core.js:39
(anonymous) @ core.js:39
load (async)
send @ core.js:39
ajax @ core.js:39
e.ajax @ core.js:92
(anonymous) @ core.js:261
setTimeout (async)
c @ core.js:261
(anonymous) @ core.js:261
u @ core.js:39
add @ core.js:39
(anonymous) @ core.js:261
i.emit @ theme.js:1
(anonymous) @ core.js:261
dispatch @ core.js:39
m.handle @ core.js:39
2productview.js:134 Uncaught TypeError: $(…).spritespin is not a function

  at HTMLImageElement.<anonymous> (productview.js:134)
  at HTMLDocument.dispatch (core.js:39)
  at HTMLDocument.m.handle (core.js:39)
Fred 24 Mar 2021, 12:01

Please test it out in incognito mode of your browser. Looks like a browser’s cache

Igor Kes 24 Mar 2021, 12:08

I opened chrome in incognito mode plus did ctrl + F5 still the same issue when I clic other combination color.

Attachments:

error2.PNG (384.1 KiB)
Fred 24 Mar 2021, 14:08

Please check out my screen record https://mega.nz/file/ENIEBDoK#aU9v9jcJGq2ro0-_9AC2aVFjez_8RUUrtclyYJcKU-k

I see only an error caused by your 360 view module

Igor Kes 25 Mar 2021, 14:20

Please check my recording. Here you have recordings: https://drive.google.com/file/d/16B3GFptcOkZy-escVK5Qi15fSvLN6bbo/view?usp=sharing

Fred 25 Mar 2021, 15:12

I don’t understand how it’s possible because I have completely removed that line of JS code.
Tested out in another browser and see the same - https://take.ms/a3Hpc