gadgetto / snipwire Goto Github PK
View Code? Open in Web Editor NEWFull Snipcart shopping cart integration for ProcessWire CMF
License: Mozilla Public License 2.0
Full Snipcart shopping cart integration for ProcessWire CMF
License: Mozilla Public License 2.0
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}',
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:
Expected behavior
jQuery loads from CDN without problems
Setup/Environment
Include relevant details about your environment setup.
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
to: $out .= (!empty($snipwireConfig->jquery_js_integrity) ? ' integrity="' . $snipwireConfig->jquery_js_integrity . '" crossorigin="anonymous"' : '');
Thank you for this great module!
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
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.