Jump to content

Gadgetto

Members
  • Posts

    394
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by Gadgetto

  1. Hi @michelangelo, could you please post bug reports on GitHub: https://github.com/gadgetto/SnipWire/issues?q=is%3Aopen+is%3Aissue And please include the complete configuration of your currency (screenshot?) from within Snipcart. Questions and suggestions regarding SnipWire are OK here, but it's very hard to follow bug reports in this forum...
  2. A demo would be a bit tricky as it would require a valid Snipcart account. No final live project on my side so far ... I'm sure there are some developers here which already have a Snipcart shop to show. ?
  3. Yep! And thanks for your kind words! I have many ideas for upcoming features and to improve the quality of SnipWire.
  4. PayPal is directly supported by Snipcart. You need to have a look into your Snipcart dashboard under „Payment Gateway“.
  5. The products from your product pages will be added to the Snipcart dashboard when you save a product page within ProcessWire. But this will only work if your site is reachable from web. So within a MAMP system it doesn't work unless you provide a way to redirect requests to your internal MAMP server.
  6. You need to go to your Snipcart dashboard: https://app.snipcart.com/dashboard and work through the setup steps there. After this configure SnipWire and it should work. Especially the "Configure your domains" part is important to tell Snipcart where it can find your product pages to allow the Snipcart crawler to verify your products.
  7. UPDATE 2020-07-03 SnipWire 0.8.7 (beta) released! This update fixes some small bugs and adds an indicator for TEST mode: Added ProcessWire notice to flag SnipWire TEST mode Updated exchangerates API to handle unsupported currencies All modules and class files are now using ProcessWire's classLoader Fixed badges display when no refunds possible (in order details - refunds form) Fixed a page select problem with custom cart fields
  8. This is not yet implemented, sorry. But it’s on my list and it will be the next feature to be added. @LostKobrakai @fruid Sorry for my stupidity, this is already implemented in a rudimentary way. You need to add the preinstalled field snipcart_item_custom_fields to your products template. This is a textarea where you can add custom configuration options for your product by using the data-item-custom*-* syntax described here: https://docs.snipcart.com/v2/configuration/custom-fields#product-custom-fields Sample code: data-item-custom1-name="Print label" data-item-custom1-required="true" data-item-custom2-name="Size" data-item-custom2-options="Small|Medium|Large" data-item-custom2-value="Medium" data-item-custom3-name="Gift" data-item-custom3-options="true|false" As I said - this is a rudimentary way to add options to your products. As this method only allows to select/change product options after they are added to the cart, I need to find a reliable way to generate those data-item-custom*-* tags from regular ProcessWire fields so they can be selected directly on the product detail page.
  9. This is possible by using SnipWires built in hookable event handler methods! All hookable event handler methods will return an array containing payload Snipcart sent to your endpoint. An "order completed" event also holds the detailed customers data, which can be used to generate/update a PW user. How to use the hookable event handler methods (sample): $webhooks->addHookAfter('handleOrderCompleted', function($event) { $payload = $event->return; $userRaw = $payload['user']; // <-- will hold the neccessary data for creating a PW user // ... your code here ... }); PLEASE NOTE: those hooks will currently only work when placed in init.php or init() or ready() module methods! Here is a full sample of a payload content you will get when an order is completed (look at the "user" part!):
  10. If you have higher volumes of sales Snipcart offers special prices. Just contact them. They are very flexible!
  11. Sorry for my bad English! I meant - this is on my todo list! It will definitely be implemented. The full cart system is JavaScript based - so it should be all possible what's possible with JS.
  12. The easiest way is to use SnipWire: https://modules.processwire.com/modules/snip-wire/ Product variations is one of the open points in my module SnipWire. It's fully customizable - just see how this works here: https://docs.snipcart.com/v2/getting-started/customization It's easy by using the hookable webhook methods of SnipWire module! Snipcart validates an order's integrity, by using the values specified in the data-item-url attribute of each product. If you submit an order, Snipcart crawls your website and compares the submitted values with the stored values of the products. It's impossible to manipulate an order.
  13. SnipWire provides sample templates to demonstrate how shop products could be rendered and is only thought as a starting point. Using the "Regular" site profile for displaying shop products within blog categories would not make sense as the blog articles are formatted very differently. You would need to write your own category template for listing shop products within categories.
  14. The stated library has a MIT license so this should not be a problem. As the library has no external dependencies I'm only using the content of the "src" folder within my module. I copied it manually into "/vendor/vat". This works like a charm: wire('classLoader')->addNamespace('Ibericode\Vat', __DIR__ . '/vendor/vat'); use Ibericode\Vat\Rates; ... $cachePath = $this->wire('config')->paths->cache . 'vat-rates.txt'; $rates = new Rates($cachePath); $rate = $rates->getRateForCountry('NL'); // 21 bd($rate); Edit: I finally copied over the full library including LICENSE and so on.
  15. I'd like to use the following PHP library within my module: https://github.com/ibericode/vat I have a "vendor" folder within my module's file structure where I'd like to place the library. How can this be achieved using the WireClassLoader methods? Would this work: wire('classLoader')->addNamespace('Ibericode\Vat', __DIR__ . '/vendor/vat'); use Ibericode\Vat; I don't understand how all the Ibericode\vat subclasses are loaded.
  16. I see you put TrelloWire within the namespace of ProcessWire. Is there any benefit or is that just a matter of taste?
  17. If I understand this correctly: the classLoader is loading classes via spl_autoload_register with addNamespace you tell the classLoader which classes to load (properties: namespace + path to the class files) this makes manually including of all class files from a specific folder obsolete What I don't understand: wire('classLoader')->addNamespace('SnipWire\Helpers', dirname(__DIR__) . '/helpers'); Would this preload all class files from within the /helpers directory? I still don't get the real purpose. This is probably as I also don't exactly know how the composer autoloader works...
  18. This would compile the file for PW 3.x or not? (seems to be an older project)
  19. I've read the API docs for classLoader, but this didn't help. No explanation, no sample code ...
  20. Hi there, i am looking for a good guide for the correct use of the WireClassLoader class within a module. The Informations that can be found on this topic are very sparse. I generally have little experience with PHP namespaces and have just started using them in SnipWire. For example, I had a look at the module "Sitemap" by Rockett: https://gitlab.com/rockettpw/seo/markup-sitemap/-/blob/master/MarkupSitemap.module.php Unfortunately I can't really figure it out either. Below is a short snippet from the original code. The questions I would like to ask: Doesn't the file need a namespace on top? In which namespace resides this class? (doesn't look like its the ProcessWire namespace?) What exactly does the addNamespace method do? Does it replace all the require_once directives? <?php // Require the classloaders wire('classLoader')->addNamespace('Thepixeldeveloper\Sitemap', __DIR__ . '/src/Sitemap'); wire('classLoader')->addNamespace('Rockett\Concerns', __DIR__ . '/src/Concerns'); wire('classLoader')->addNamespace('Rockett\Support', __DIR__ . '/src/Support'); use ProcessWire\Language; use ProcessWire\Page; use ProcessWire\WireException; use Rockett\Concerns; use Rockett\Support\ParseFloat; use Rockett\Support\ParseTimestamp; use Thepixeldeveloper\Sitemap\Drivers\XmlWriterDriver; use Thepixeldeveloper\Sitemap\Extensions\Link; use Thepixeldeveloper\Sitemap\Url; use Thepixeldeveloper\Sitemap\Urlset; class MarkupSitemap extends WireData implements Module { ... } Maybe someone could help me to understand this? Greetings, Martin
  21. Even if your requirements are very basic it would be much easier to use the SnipWire module, because it comes with all necessary product fields and settings and an easy to use API variable to output cart and products.
  22. The sample templates, which come as an additional installation, are based on the Regular site profile which is based on Markup regions output strategy and UIKit CSS framework. ukIcon is a function in _uikit.php which is part of the regular site profile. If you are using another profile or output strategy, you'll need to rewrite the template source. If you like to run a quick test - just install PW using the "regular" profile.
  23. I recently published a new PW module called SnipWire which fully integrates the Snipcart shopping cart system + full features PW dashboard: Depending on you needs, Snipcart could be a good choice. With SnipWire the implementation into your ProcessWire driven site is very easy. Snipcart takes 2% fees per transaction, which seems to be odd, but if you calculate the cost of developing and implementing another shop-system, the costs are quickly relativised.
×
×
  • Create New...