Shopkit commerce plugin

I was checking as this is not my server: 5.4.40

Then I think it is the call to empty that doesnā€™t work with versions. below 5.5. in this context. You should really no longer use PHP versions below 5.6 and ideally upgrade to 7.x.

In any case, since version 2.5.11, Kirby doesnā€™t support PHP versions below 5.6 anymore.

1 Like

i use a very early version. and in the background i have to merge my old stuff n styles to the new version.

but now i want to get an quick solution to show on my front page /shop all products at all sort by date.
i tryed to copy the catagory code on my shop.php but thats not the solution.

can someone help me? :slight_smile:

@dersven: what version of shopkit are you using? Probably just a couple tweaks need to be made to the category.php code.

i think its the v1.0.3 :frowning:
my shop design and styles i have made are everywhere and not very well in one place collected. i have to do it new from sketch. but i dont have space time for it.
so i search for a tiny quick and dirty thing. --> i am an designer not an developer.

is there an ideaā€¦
how can i use the tag-template or the category-one to get an output of all products on the front without choosing a categorie?

Try this snippet, @dersven. It will create a list of all products that are visible.

<?php
  snippet('list.product', [
    'products' => page('shop')->index()->filterBy('template', 'product')->visible()
  ])
?>
1 Like

oh thanks.

is it possible to sort the products in the otherway round. the last products first?
how about ->sortBy // But my idea doesnt work.

snippet('list.product', [
    'products' => page('shop')->index()->filterBy('template', 'product')->sortBy('sort', 'asc')->first();->visible()

To get the last product first, you probably want ->sortBy('sort', 'desc').

->first() is probably not what you want, as that will only return one product.

thanksā€¦

now i am confused. i have take the old code into the shop.php

    <!-- Featured products -->
<?php
    // Rebuild the featured products list with actual page objects instead of URIs
    $index = $pages->index();
    foreach (page('shop')->featured()->toStructure() as $f) {
        $featuredProduct = $index->findByURI($f->product());
        if ($featuredProduct->isVisible()) {
            $featured[] = [
                'product' => $featuredProduct,
                'calculation' => $f->calculation()->value
            ];
        }
    }
?>
<?php if(isset($featured) and count($featured)){ ?>
    <div id="featured-products">
        <?php snippet('list.featured', ['products' => $featured]) ?>
    </div>
<?php } ?>

and now there is an error like:

 **Fatal error** : Call to a member function isVisible() on boolean in shop.php 

#itstowarm

This code doesnā€™t seem to return a page object, but without knowing what is stored. in. $f->product() and your page structureā€¦

The code you listed is not part of templates/shop.php. That file should look like this: https://github.com/samnabi/shopkit/blob/v1.0.3/site/templates/shop.php

Are you trying to put this product list in the sidebar? Thatā€™s where the code you posted comes from. https://github.com/samnabi/shopkit/blob/v1.0.3/site/snippets/sidebar.php

thanks a lot for your plenty answers.

yes i have cleaned the markup for my own style. i dont have a sidebar, and my featured products are listed most of all my products. so i use the featured code snippet on my shop.php.

i have made a mistake. and now, if i would switch to the old files. this visible error appyed. and no shop item will displayed. :frowning_face:

Please post the full code of your shop.php template file. (or send it to me privately if there is sensitive information)

Oh no. I have to apologize samnabi. sorry!

While I changed the shop.php, the visibility of all products has also changed. I did not pay attention to that.
Now all products are visible again and it works just fine.
Thank you very much for your help.

I like the ShopKit setup and that itā€™s based on Kirbyā€¦ new to Kirby and first post! :smile:

Anyways. Are there any plans of adding Stripe Billing support? I would like to use this for subscriptions and we use Stripe now. I have plans with multiple variants that fit really well into the shopkit layout with the exception of the checkout using stripecheckout. Iā€™m not a very good PHP developer but Iā€™m going to take a look and see how difficult it would be to add a stripebilling provider and a entry to the blueprint to mark the item as a subscription so it will automatically use the correct stripe checkout methodā€¦ I donā€™t think it will be too difficult and others may like this feature?

@simplextech According to the readme, Stripe icheckout is included as payment gateway.

Iā€™m not planning to add recurring payments as a Shopkit feature. It was on the roadmap for a while, but every time I tried to tackle that problem it turned out to be very difficult to do while remaining gateway-agnostic: https://github.com/samnabi/shopkit/issues/74

That said, please reply here or file an issue on GitHub if you run into issues with your integration, Iā€™ll do my best to help.

@texnixe yes Stripe is supported as a payment gateway for ā€œChargesā€ not ā€œBillingā€.

@samnabi, Iā€™ll poke around and see what I can do. I modified SCK over the last few nights and itā€™s working well for me but I want to have a ā€œcartā€ like system in place for devices and it would be nice for it to be a unified checkout feeling. Iā€™ll see what I can do, Iā€™m better on the back end than the front end with coding anyways.

For the life of me tonight I canā€™t get nested navbar menu items to display correctly!

v2.5 is here :hourglass_flowing_sand:

Now Shopkit and Kirby have the same major & minor version numberā€¦

Download it here: https://github.com/samnabi/shopkit/releases/tag/v2.5

Changelog

  • Update Kirby and Panel to 2.5.12 (PHP 5.6+ now required)
  • Improve shadow & overlay display in IE (for category tiles)
  • Bug fixes
    • Fix errors in shipping calculations for products with custom shipping rules
    • Remember userā€™s selection for custom shipping options in the cart
    • Fix undefined $timestamp error when a downloadable product is not the first to be added to the cart
    • Fix hidden submit button on payment form when mailing address is hidden
    • Use Kirby download() function instead of manually setting headers for downloadable products
    • Fix false positive in appliesToCountry()

Itā€™s great to hear that you took such an opportunity, brave and also ā€¦ healthy!

I wonder, do you have any experience adding Shopkit to an existing Kirby installation? I know that the general rule of thumb is to begin with a fresh install but ā€¦ just curious :slight_smile:

All the best,
daybugginā€™