Shopkit commerce plugin


#183

I was checking as this is not my server: 5.4.40


#184

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.


#185

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:


#186

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


#187

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?


#188

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()
  ])
?>

#189

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()

#190

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.


#191

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


#192

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


#193

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


#194

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:


#195

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


#196

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.


#197

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?


#198

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


#199

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.


#200

@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!


#201

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()