usbong / UsbongStore

The "Usbong Store (Web)" is built using the Usbong eCOM Toolkit. It enables multiple merchants to offer their products via only one store *web* app.
0 stars 1 forks source link

Mobile Responsive Header Can't Display Number of Items In Cart #117

Closed zent-lim closed 6 years ago

zent-lim commented 6 years ago

Hi Mike,

While doing Phase 3, I saw that in mobile responsive header, view file is not able to display cart item count.

screenshot-2018-9-14 usbong store 2

Problem: always 0

View File: views/templates/header_v2.php

ANALYSIS

In old view file, the data source is below (mobile responsive version uses the same source):

File: views/templates/header.php

Line of Code: $totalQuantity = $this->uri->segment(5);

However, when I look at 5th element of sample url (after index.php), there is no such element.

Url: https://store.usbong.ph/index.php/w/BJT-Business-Japanese-Proficiency-Test-Practice-Test-and-Strategies-with-CD-JAL-Academy/122

Note: The url above has at most 3 segments.

QUESTION

How do I access cart count from view file?

Thank you.

masarapmabuhay commented 6 years ago

Hi Zent, Thank you for opening this ticket/issue.

I am unable, though, to reproduce the problem.

I've used both Mozilla Firefox and Microsoft Edge browsers.

1) Firefox Quantum 62.0 (64-bit) 2) Microsoft Edge 40.15063.674.0 and Microsoft EdgeHTML 15.15063

So I may be able to properly answer your question, may I first ask if you are using the newest version of the Usbong Store code?

Please make sure that you also have the following files:

1) .../views/templates/style.php 2) .../views/templates/style_v2.php

Thank you.

Peace, Mike

zent-lim commented 6 years ago

HI Mike,

Yes. I'm using the latest version of the app.

Sorry. I did not leave instructions on how to recreate the problem.

(1) Step 1 - Make sure cart is empty.

 (a) Sign in.

 (b) Go to cart and clear it.

       Url: https://store.usbong.ph/index.php/cart/shoppingcart

(2) Activate mobile responsive switch.

  File: file:///var/www/html/UsbongStore/usbong_store/application/core/MY_Controller.php

  Note:     $this->setMobileResponsive(TRUE); // set to true instead of false

(3) Checkout any item from any w pages. Below is sample url

  Url: https://store.usbong.ph/index.php/w/A-Brief-History-of-Time-Stephen-Hawking/233

  After you checkout an items, upper right cart icon should be 1.

(4) Now compare any mobile responsive page vs any none mobile responsive page.

  Mobile responsive page (books): https://store.usbong.ph/index.php/b/books/

  Non mobile responsive page (home): https://store.usbong.ph/index.php/

  In mobile responsive page, cart count is 0 while in non mobile responsive page, cart count is 1.

QUESTION

(1) May I know if you can re-create this?

(2) If yes could you explain how I can access cart count from view file so I can update cart count for mobile responsive header? (I looked at header.php but could not trace how the value was derived.)

Thank you.

masarapmabuhay commented 6 years ago

Hi Zent, Thank you for the reply.

I was able to re-create the problem. Note that I took your "checkout" to mean "use the 'ADD TO CART' button".

I've also committed and pushed the update to master (https://github.com/usbong/UsbongStore/commit/fedb5d3b9e8897d8bf5c955e9ae17bfce86b04f4)

I had to update two files. 1) ...core/MY_Controller.php 2) ...views/templates/header_v2.php

As to the following line of code in ...views/templates/header.php, I'll have to read and understand the code again to verify if it is still necessary.

$totalQuantity = $this->uri->segment(5);

Action Items: 1) Add: code refactoring to Usbong's TODO/TO-DO list --> Owner: Mike 2) Close: this ticket/issue if it resolves the problem on your local server --> Owner: Zent

Thank you.

Peace, Mike

zent-lim commented 6 years ago

Hi Mike,

Thank you very much for the code update.

I have verified that the update fixed the problem. :)

Happy monday!

P.S. In your code push, app is now mobile responsive by default. Not sure if you want that cause in the past, you preferred non mobile responsive version by default.

masarapmabuhay commented 6 years ago

Hi Zent, Thank you for the reply.

OK! I shall now close this ticket/issue. If you disagree, please simply reopen it.

Thank you.

Peace, Mike p.s. Let's keep the Mobile Responsiveness switch set to TRUE.

zent-lim commented 6 years ago

Copy.

Thank u Mike. :)

On Tue, Sep 18, 2018, 8:12 PM Masarap Mabuhay, notifications@github.com wrote:

Hi Zent, Thank you for the reply.

OK! I shall now close this ticket/issue. If you disagree, please simply reopen it.

Thank you.

Peace, Mike p.s. Let's keep the Mobile Responsiveness switch set to TRUE.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/usbong/UsbongStore/issues/117#issuecomment-422367703, or mute the thread https://github.com/notifications/unsubscribe-auth/AHplT9yyquWLEaqBlC9uqnXs1l_ctHPaks5ucOMugaJpZM4Wo1NW .