Giter Club home page Giter Club logo

snipwire's People

Contributors

gadgetto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

gebeer

snipwire's Issues

Dashboard for non SuperUsers unavailable

when a user role with snipwire-dashboard permissions clicks on the additional tabs (Orders, Subscriptions, Abandoned Carts, Customers, Products, Discounts) within the Dashboard, they reach the 404 page instead.

Polish Złoty missing as currency

The currency is supported in the Snipcart backend but SnipWire has trouble displaying it.

Here are 2 screenshots from Snipcart and Snipwire respectively:
Screenshot 2020-09-16 at 17 06 50
Screenshot 2020-09-16 at 17 06 05

and from the front-end:
Screenshot 2020-09-16 at 17 09 06

“https://code.jquery.com/jquery-3.3.1.min.js” is not eligible for integrity checks since it’s neither CORS-enabled nor same-origin

Describe the bug
After installing SnipWire, I get this error in the dev console on the frontend:
“https://code.jquery.com/jquery-3.3.1.min.js” is not eligible for integrity checks since it’s neither CORS-enabled nor same-origin

To Reproduce
Steps to reproduce the behavior:

  1. install SnipWire
  2. open Frontpage
  3. open dev console and watch for errors

Expected behavior
jQuery loads from CDN without problems

Setup/Environment
Include relevant details about your environment setup.

  • ProcessWire version: 3.0.175
  • (Optional) PHP version: 7.4
  • (Optional) MySQL version: 5.7.35
  • (Optional) Any 3rd party modules that are installed and could be related to the issue: not relevant

Proposed Solution
Add the crossorigin="anonymous" attribute to the script tag which loads jQuery from CDN. The script tag should read:
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>

I have done this by changing

$out .= (!empty($snipwireConfig->jquery_js_integrity) ? ' integrity="' . $snipwireConfig->jquery_js_integrity . '"' : '');
to:

            $out .= (!empty($snipwireConfig->jquery_js_integrity) ? ' integrity="' . $snipwireConfig->jquery_js_integrity . '" crossorigin="anonymous"' : '');

Thank you for this great module!

Support for alternative price lists in combination with discounts

Need to create a special field type which offers alternate price list creation.

Snipcart will look at the product definition (anchor output) to see if there is a price matching the alternate price list.

For instance, if you want to offer special prices to your VIP customers, you could add a discount that uses an alternate price list named "vip". In your product definition, you would have to add: data-item-price-vip="100.00"

Once the discount is applied, Snipcart will change the item price in the cart to the one defined by the alternate price list

Uncaught error when trying to access dashboard

Everything seems to be running smoothly, I have installed the Snipcart product package, can add the products to the cart and proceed to checkout. But when I try to access the SnipWire dashboard, I get the following error:

Fatal Error: Uncaught Error: Call to a member function getProducts() on null in /var/www/vhosts/xxx/site/modules/SnipWire/services/SnipREST.php:304

Mode: Test mode
SnipWire version: 0.6 (latest)
PW version: 3.0.149 dev

Installer error: Can’t save page 0: /custom-cart-fields/: It has no parent assigned

Describe the bug
Issue poste in PW forums by @craig: https://processwire.com/talk/topic/21554-snipwire-snipcart-integration-for-processwire/page/6/?tab=comments#comment-199438

I'm testing it out at the moment, and have come up against the error that was previously reported:

Can’t save page 0: /custom-cart-fields/: It has no parent assigned

Having dug into the code, I think I found the cause. My test PW installation is in a subdirectory - not its own host - and snipWireRootUrl returns the full path include the folders:

/misc/pw-snipwire/processwire/setup/snipwire/

In the installer, as this variable is only used to set the parent page for custom-cart-fields, could ExtendedInstaller.php be updated to use the path instead of full URL?

I updated it like this, re-installed, and it worked:

// In ExtendedInstaller::__construct():

$this->snipWireRootPath = rtrim($this->wire('pages')->findOne('template=admin, name=snipwire')->path, '/') . '/';

// in _installPage():

// Page "parent" key may have "string tags"
$parent = \ProcessWire\wirePopulateStringTags(
    $item['parent'],
    array('snipWireRootPath' => $this->snipWireRootPath)
);

// In SystemResources.php

'parent' => '{snipWireRootPath}',

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.