问题标签 [snipcart]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1510 浏览

php - cakephp 和 Webhooks

我是 cakephp 新手,并且已经实现了 Webshop 解决方案 Snipcart。当 snipcart 处理订单时,他们会向我们的网站发送一个 webhook。根据他们的文档,webhook 看起来像这样:

并且使用 webhook 看起来像这样:

我的问题是,我如何在 CakePHP 2.4 版中做到这一点。我已经在互联网上寻找了几天的解决方案,但是我没有经验,我找不到合适的解决方案。

解决了它:

0 投票
0 回答
300 浏览

jquery - 使用后退按钮时如何使简单的标签/手风琴记住标签?

我们对手风琴设置有一个基本的响应标签,如下所示:

我们还使用 Snipcart,#!/cart如果购物车被激活,它会添加到任何 url 的末尾。当购物车关闭时,它会留#!/在 URL 上。

我们将如何让标签与浏览器的后退按钮一起使用 - 并让它们与 Snipcart 配合得很好?

0 投票
1 回答
721 浏览

stripe-payments - 用 SnipCart 连接 Stripe

我想使用 Stripe 作为 SnipCart 的支付网关,但我似乎在任何一方的文档中都找不到明确的指南。如果有人至少能指出我正确的方向,我将不胜感激。

0 投票
0 回答
239 浏览

jquery - Updating button data attributes based on changes on separate form elements

I'm working on a Snipcart site where data attributes for prices on the .button element are updated based on radio buttons that are selected.

Currently what I have which is working fine is this:

HTML

JS

So when you change the radio buttons, the data-item-price on .button is updated and when you click on the button, that value is then added to the cart (which is how Snipcart works).

But now I have to introduce another select element which introduces different categories which have different prices which when changed will dynamically update the prices.

Currently the three subscription prices are set server side before being delivered to the template. Now those three prices can be changed based on the value of the dropdown below.

I thought I'd need to do something again with data attributes:

but I'm not really sure about the best approach for combining what I already have with the new select element.

Can I have the one element change the data attributes of the other and have a script listen for silent updates as well as on.change/input?

0 投票
1 回答
582 浏览

javascript - 更改选项时更改选定按钮

我正在尝试使按钮在选择特定选项时发生变化。或者,如果有人能告诉我如何更改一些文本和价格以最小化代码,那就太好了!

0 投票
1 回答
356 浏览

php - 自定义 Snipcart 订单仪表板

我正在尝试使用他们的订单 API创建一个自定义的 Snipcart 订单仪表板,但从这个开始:

我没有从$resp. 不知道我哪里错了。

0 投票
1 回答
1140 浏览

angular - Angular 2 index.html - 开发和生产不同

我需要在我的 Angular 2 项目中实现 snipcart。下面的脚本标签需要插入到我的 index.html 文件的头部。

但是,开发和生产环境的 data-api-key 不同。我该怎么做?

脚本标签在 index.html 文件中是可用的,这一点很重要,snipcart.com 将出于安全目的进行检查。

我曾尝试在运行时执行此操作:在 index.html 文件中添加不带 src-url 的脚本标签,然后在 main.ts 中使用正确的 api-key 值和 src-url 更新标签属性。

这样 snipcart 使用正确的密钥运行,但来自 snipcart.com 的验证失败。

所以我需要在编译时设置 api-key。我的 index.html 需要在开发和生产模式上有所不同。

我的项目是用 angular cli 创建的:

谢谢,

干杯

格尔德

0 投票
2 回答
840 浏览

javascript - php - 回显选择值而不提交

我有一个使用 snipcart 的服装网站,目前没有内置的尺寸或颜色选择器,所以我需要自己做,把它放在描述中,这样我们就可以知道要发送什么。无论如何,我需要在按钮数据中回显颜色和大小的选定值。

这是我的代码:

我需要在按钮的数据中回显颜色和大小,所以它看起来像这样:

I've tried this: but i think i would need a code for it to change the button data when the value for the select input is changed

0 投票
0 回答
207 浏览

testing - SnipCart 和 Authorize.net 集成

我想知道您在测试 SnipCart 与 Authorize.net 集成方面的经验。

我有一个网站,用户可以使用 SnipCart 界面购买数字产品。现在,我只想在付款成功的情况下才允许访问此产品。为了做到这一点,该站点正在监听 webhook(来自 SnipCart 和 Authorize.net)。问题是,SnipCart 不允许您与沙盒 Authorize.net 帐户集成。而且我想避免在实施阶段进行真正的付款和退款。目前,我只是手动测试了它(测试模式下的 SnipCart 并通过 Authorize.net 虚拟终端付款)。另外,一切都按预期工作。

我想知道,如何将 Authorize.net 交易与 SnipCart 订单配对?您知道 Snipcart 使用哪些信息将其订单与付款相关联(SnipCart 订单令牌、发票编号)吗?

我无法从他们的文档中找到这些信息。

谢谢你的回答。

0 投票
2 回答
407 浏览

c# - 将 CURL 请求转换为 C# 以访问 Snipcart API 返回 401 Unauthorized

我正在尝试访问 Snipcart API(参考 - https://docs.snipcart.com/api-reference/authentication)。我创建了一个 API 密钥并按照文档中提到的步骤进行操作。

我正在尝试将 CURL 请求转换为 C#。我选择使用 HttpWebRequest。我从服务器返回 401 Unauthorized。我无法弄清楚我的请求有什么问题。

实际卷曲请求:- curl -H“接受:应用程序/json” https://app.snipcart.com/api/orders -u {API_KEY}:

以下是我尝试将上述 curl 请求转换为的代码