Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loaders does not work on the Shopify Narrative theme #55

Open
gvisniuc opened this issue Apr 12, 2020 · 4 comments
Open

Loaders does not work on the Shopify Narrative theme #55

gvisniuc opened this issue Apr 12, 2020 · 4 comments

Comments

@gvisniuc
Copy link

Describe the bug
Hi there,
I have recently implemented the load more button on a Brooklyn theme and worked perfectly.

However when implemented on a new Narrative theme it fails to load the new objects (the request does succeed it's just the visual part not working).

I investigated a bit and seems to be the cardManager object in theme.js responsible for loading the new content.

I would really appreciate some assistance or guidance if possible.

The section responsible for rendering:


    <div class="card-list grid" data-desktop-columns="{{ desktopColumns }}" data-mobile-columns="{{ mobileColumns }}" data-grid-style="{{ section.settings.grid_style }}">
      <div class="card-list__column{% if totalProducts == 1 %} card-list__column--center{% endif %} grid grid__item {{ gridClasses }}">
        <div id="ajaxinate-loop" >
        {% for product in collection.products %}
          {% include 'product-card', product: product, grid_style: section.settings.grid_style %}
        {% endfor %}
        </div>
      </div>
    </div>

To Reproduce
Steps to reproduce the behavior:

  1. Create narrative theme
  2. Add load more button and script
  3. Click load more

Screenshots

ajaxinate

Desktop (please complete the following information):

  • OS: macOS Catalina
  • Browser: Chrome
  • Version 80
@Cam
Copy link
Member

Cam commented Apr 15, 2020

Hey @gvisniuc. I'm 99% sure you'd just need to call whatever function is dynamically adding the content to each of the paginated items.

There's a callback option available for exactly that.

I'm a little hard pressed for time at the moment, but I'll try to get some of the more popular themes up in the demo store with some examples as soon as I can.

@Cam
Copy link
Member

Cam commented Apr 15, 2020

The documentation should ideally have some more info on the callbacks too.

@gvisniuc
Copy link
Author

Hi @Cam Thank you for the reply.

I did eventually implement a callback logic, but indeed documentation on that from Shopify is non existent.

The issue is that even after triggering the callback function to reload the items in the cardManager object, the items are prepended instead of appending them.

Looking forward for a solution in the future when you have some time.

@chartalex
Copy link

Hey @gvisniuc !

I'm also stuck here :(

Have you found a solution for a callback function to trigger the CardManager?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants