Giter Club home page Giter Club logo

oc-snipcartshop-plugin's Introduction

oc-snipcartshop-plugin

This plugin is no longer maintained!

If you use Snipcart with October feel free to form this repo.


Ecommerce solution for October CMS using snipcart.com as a backend.

Demo: https://snipcart.offline.swiss

Please note: this plugin is not affiliated with Snipcart directly. It simply provides an easy way to use the third-party e-commerce service with October CMS. Therefore, Snipcart-specific questions may need to be directly put through Snipcart's support. We'll provide support for plugin-specific questions, and plugin maintenance.

Features

  • Multi-currency
  • Multi-language (via Rainlab.Translate, Backend available in german and english)
  • Discounts and coupon codes
  • Inventory management
  • Product attributes and variants
  • Product links and downloads
  • Update orders directly from the October CMS backend
  • OFFLINE.SiteSearch support
  • Fully functional and responsive demo theme ready to download

Quickstart

  1. Create an account on snipcart.com
  2. Add the snipcartshopDependencies component to your layouts. This component includes all needed js and css files from the snipcart servers. jQuery can be included optionally as well.
  3. If you are using Rainlab.StaticPages, add a new menu entry of the type all shop categories to your navigation.
  4. Create a page and add the products component to it's markup. If you want to filter the product category by url parameter don't forget to select "Get category from url" as category filter option. Give it a url like /category/:slug* (don't forget the star if you want to use subcategories). Select this page in the plugin's backend settings under category page.
  5. Create a page and add the product component to it's markup. Give it a url like /product/:slug. Select this page in the plugin's backend settings under product page.
  6. Setup at least one currency in the plugin's backend settings. Set up the same currencies in your Snipcart dashboard under Account / Regional Settings.
  7. If you are using discounts, make sure to set up Task scheduling for your October installation. This way the discount usage stats will get updated every hour.
  8. Create a public and a private API key in your Snipcart dashboard under Account / Credentials. Paste both keys in the respective input field in the plugin's backend settings.
  9. Copy your custom webhook URL from the plugin's backend settings (under API and webhooks). Set the URL as Webhooks URL in your Snipcart dashboard under Account / Webhooks

Custom currency format

Starting with version 1.0.32 you are able to specify a custom currency format in the backend settings. The code you provide is parsed as a Twig template so all the functionality of Twig is available.

If you do not enter a specific format the following will be used

{{ currency }} {{ price|number_format(2, '.', '\'') }}

The following variables are available

Variable Description Example value
price The full price of the product as float 1500.40
integers The price without decimals 1500
decimals Only the decimals of the price 40
currency The currency code you specified above EUR
product The product model this price is from. A full model instance

These are a few example usages:

{{ currency }} {{ price|number_format(2, '.', '\'') }}

-> EUR 1'200.40
<span class="integers">{{ integers }}</span>    
<span class="separator">,</span>    
<span class="decimals">{{ decimals }}</span>    
<span class="currency">{{ currency }}</span>  
  
-> 1200,40 EUR
{{ price|number_format(2, '.', '\'') }} {{ currency }} 

{% if (product.taxable) %}
    (VAT included)
{% else %}
    (VAT excluded)
{% endif %}

-> 1200,40 EUR (VAT included)

oc-snipcartshop-plugin's People

Contributors

abhi1693 avatar alxy avatar tobias-kuendig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

oc-snipcartshop-plugin's Issues

Exception when clicking to shop link in the backoffice on a fresh install

Hello,

Just after an install, if you click on the shop link, you got an exception :

Class 'RainLab\Translate\Behaviors\TranslatableModel' not found

In the file

/vendor/october/rain/src/Extension/ExtendableTrait.php line 196

I think that's because the plugin depend on the rainlab translate plugin, but it's not mentionned anywhere (just said that it have multilanguage possibilities)

Product price should be plain text input not a repeater

Frankly i did not met any case where a Price should be entered for every currency individually.
Is there a certain thing you are targeting with this implementation?
I think Price fields in products should be text input not a repeater.
And the currency should be set globally not per product.
What i am suggesting is making the currencies configured by the store globally, the same as adding languages(already done), and the frontend currency picker just calculate and convert the relative currencies using a currency exchange api ( Yahoo for example, and can be configurable for adding other specific APIs).
What do you think @tobias-kuendig or @abhi1693 ?

"Object of class October\Rain\Database\Builder could not be converted to int" on line 177

Hello,

I installed snipcart, configured the global settings, created some sample product and now I'm trying to display simple product listing on a page.

When I add the "Products" component to my page and I click on it to configure it, I get the following popup error :

"Object of class October\Rain\Database\Builder could not be converted to int" on line 177 of /www/plugins/offline/snipcartshop/components/Products.php

I have many plugins and only this one give me that error.

I'm using SQLite database engine.

Error when adding dropdown custom field

Hello,

When I add a custom field dropdown with some options, I get an error when I click the "create" button

"SQLSTATE[HY000]: General error: 20 datatype mismatch (SQL: insert into "offline_snipcartshop_product_custom_field_options" ("id", "name", "price", "sort_order", "updated_at", "created_at") values (, Option 1, 500, 0, 2017-06-14 13:54:22, 2017-06-14 13:54:22))" on line 666 of www/vendor/laravel/framework/src/Illuminate/Database/Connection.php

Regards,

Alex

Problem with webhook when you place order (error 500)

Hello,

I continue my tests with snipcart and tried to place a test order on the website.

I could correctly go throught the checkout process, but, once order is placed, I get a email from the snipcart team saying me that the webhook didn't work correctly.

If I go to the webhook log on snipcart website and see the details, I can see that the URL called return an error :

SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: offline_snipcartshop_orders.invoice_number

Any ideas about the problem ?

List all products in a partial

Hello,

I'm trying to customize the markup of my product list. To do that, I use the october CMS way, I call a partial /shop/list.htm and I add the component in my partial and try to loop throught the {{ products }} variable.

But it doesn't work. If I print {{ products }} I don't get the products object, it just display a "products" string.

It works if I put the component in a page.

Is there any limitation that could explain that I can work in a partial ? Cause I did this for the blog for example, and it perfectly works...

Thanks for your help

Alex

Can't uninstall plugin

Hello,

I was trying to uninstall this plugin after testing it, but I can't. When I uninstall it, i got a popup error that prevent me to finish uninstall :

"There is no column with name 'properties' on table 'offline_snipcartshop_products'." on line 86 of /www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaException.php

Any help would be appreciated, can't uninstall plugin properly ATM.

Thanks

Alex

SQLSTATE[42S02]: Base table or view not found

Hello,

When I try installing the plugin, I get the following error. I've seen that not having MySQL 5.7.8 can cause the issue, but I cannot update it as my host doesn't support it.

It's odd because I've had it working in the past on a different site, although that was months ago. I really appreciate any help!

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'armuli73_axolandfriends.offline_snipcartshop_products' doesn't exist (SQL: select offline_snipcartshop_products.*, (select group_concat(name separator ', ') from offline_snipcartshop_categories inner join offline_snipcartshop_category_product on offline_snipcartshop_categories.id = offline_snipcartshop_category_product.category_id where offline_snipcartshop_products.id = offline_snipcartshop_category_product.product_id) as categories from offline_snipcartshop_products order by name asc)

Question about database and API

Hello,

I'm studying the code of that module because I will probably have to modify it quite heavily to handle some very specific needs.

By looking at how the module is done, I have a question about the Orders and Discounts.

Why did you copied all snipcart data to local database table ? You could retrieve all the data using the Snipcart API only, and it would be easier to keep data synchronisation as the only source of information would be Snipcart.

It would also resolve the issue where you create discount on the snipcart side, but don't see it on the website.

Using the Purgeable Trait, you could keep the same models fields definition without having to save the values to the database, is there a technical reason that explain why you choose to do like that ?

Best regards,

Alex

Add more control on tax management

Hello,

I have a business when several different products can have several different tax rate applied to them.

Actually, the plugin only allow for an "Apply taxes" option to calculate taxes for that products.

The problem is that all taxes are calculated whereas I need to specify which tax apply to which product.

I firstly believed that it was a snipcart limitation so I contacted them, but it seems they can handle that case, using the "data-item-taxes" field. So I think the plugin needs to be updated to give more control about the taxes.

Best regards,

Alex

Stock management doesn't seems to work

Hello,

I'm trying to play with stock management, but it seems that, whatever I try, I'm always able to order the product.

  • Firstly : If you don't have variant, I don't see any stock field. Where do you set your stock for a simple product.
  • Secondly : I tried to add some variant and set stock for each of them. Some option have quantity in stock, some options doesn't. I don't allow to purchase product that is out of stock. I also changed the Inventory mode option to select "Article variants". I'm still able to add product to the cart.
  • Thirdly : Do you think the inventory management method field is required ? I would suppose that if you product have some variant, you need to be in article variants mode, and if not, normal mode. I think it can be deducted automatically.

So I don't understand how stock management works, could you please give me some help about this.

Thanks

Alex

Variant selection product page

Hello,

Nice plugin, snipcart seems very interesting and your implementation seems to be quite flexible to create a nice shop with it.

However, I wonder if it's possible to add variant selection of products directly on the product page instead of the cart.

For example, I don't think it's relevant to put variant if you sell clothes for example, the customer whant to be able to choose the color or the size before adding the product to the cart.

Thanks and continue that great work.

Regards,

Alex

Short description of products is empty

Hello,

In my objective of customizing the markup for a product list, I discovered that the {{ product.description_short }} value is empty, even if I fill the short description field in the backoffice.

Probably a typo somewhere or something like that cause the images, the name etc... are available.

How to customize the formatted price ?

Hello,

I noticed that, when you want to display the formatted price, there is a {{ product.priceFormatted }} twig variable.

However, it display price like that (example with euros) :

EUR 10.00

How to display price like that :

10,00€

In addition, it would be great to display if the price is including or excluding taxes, for example :

10,00€ (Inc. VAT) or 10,00€ (Exc. VAT)

Thank you for your help

Alex

Show a continue shopping button

Here is how you can add the Continue Shopping button to the cart.

Will need to expand the dependencies component code and add this:
Snipcart.execute('config', 'show_continue_shopping', true);

The second script in the dependencies component code should look like this:
<script>
Snipcart.api.cart.currency('{{ snipcartDependencies.activeCurrency | lower }}');
Snipcart.execute('config', 'show_continue_shopping', true);
</script>

This would be a nice addition as an option in configuration settings. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.