Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#853 2016-03-24 08:07:01
- dorka
- Member
- Registered: 2012-10-04
- Posts: 90
Re: yab_shop (simple textpattern shop with paypal support)
Destry, thanks for the contribution i am sure it might come handy for someone here.
In my case though, I am not sure bundling shipping fees to paypal is good solution. The common practice in Czech republic is using 3 diferent ways of paying: 1. Sending money in advance to a bank account, 2. online payment (Paypal has alteratives here as everyhwere else I suppose) and 3. paying on delivery, which is by far the most popular. This is something the post office does. So, no Paypal needed. As far as transport fees are concerned, a popular option here is picking the ordered products either in a near by warehouse (no shipping costs), or in a automated delivery boxes in your neighbourhood (cheaper shipping costs) , you can also choose from diferent rates acording to wheather you want the goods delivered the same day or within few days. All these options may be handeled by diferent services. I am pretty sure similar services are avaliable all over the Europe and elsewhere, too, Cz is not an exception.
So I think, that more flexible way to offer shipping cost options will be widely appreciated.
Offline
#854 2016-03-24 09:13:07
Re: yab_shop (simple textpattern shop with paypal support)
dorka wrote #298406:
more flexible way to offer shipping cost options will be widely appreciated.
Just as a side-note, my fork of this plugin offers multiple shipping options based, primarily, on weight of goods. But you could also use the system to create multiple couriers who offer different services (24 hour delivery, next day, by 9am, etc, etc). Customers can then select the service they require from the dropdown of available options (some of which may not be available depending on the size/weight of their goods, if you choose to take this into account).
The other advantage of the forked plugin is with PayPal. In Trenc’s yab_shop, the address fields are mandatory. This can create a disconnect with PayPal, because you have to supply your address in yab_shop, then click to pay with PayPal. At that point, if you choose an address from your PayPal address book, the address you entered in yab_shop is entirely ignored. Thus you’ve entered the details for no reason.
The forked plugin allows you to specify which yab_shop fields are optional so you can skip straight to PayPal and checkout without needing to type the address first.
The plugin does work slightly differently to Trenc’s though, and there’s no direct upgrade path for the language strings yet (which is a shame, but I haven’t got round to doing the Textpack work yet) so if you are going to try it, backup everything first.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#855 2016-03-24 11:38:32
- dorka
- Member
- Registered: 2012-10-04
- Posts: 90
Re: yab_shop (simple textpattern shop with paypal support)
Thanks Stef,
your energy is amaizing! You’ve been everywhere! :-)
One of these days I will try your sugestion, but right now I will appreciate really, really much if someone could at least tuck in a check box delivery yes/no, so that I can publish the damn thing. I have tried to do this myself, but my knoledge of the language is too poor. :-(.
Offline
#856 2017-01-29 05:12:56
Re: yab_shop (simple textpattern shop with paypal support)
yab_shop issue with txp version 4.6.2
After updating to txp version 4.6.2, yab_shop has stopped working on my site:
- On the product page, the product options are not visible anymore, the button’s text is replaced by the text of the tag
- On the cart page, all the text has been replaced by the text of the tags
I tried updating from yab_shop 8.0 to 8.1, but it still doesn’t work.
In the extensions
tab, I checked shop_prefs
and shop_lang
Both show a Yab Shop 0.8.1 - Install
message and button. When I hit the button, I get the following error message:
Could not install language table, Could not install prefs table
It also gives this error when in testing mode:
A problem occurred while loading the plugin: yab_shop_admin -> Warning: mysql_num_rows() expects parameter 1 to be resource, object given on line 249
Please assist!
Last edited by Kjeld (2017-01-29 14:42:54)
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
#857 2017-01-29 22:31:57
Re: yab_shop (simple textpattern shop with paypal support)
I’ve hacked Kjeld’s copy of yab_shop for 4.6.x. Can’t say I’ve caught everything yet, but it seems to be holding up. For anyone who wants to update their copy of yab_shop 0.8.1 to work on Txp 4.6.2, here’s the diff you can apply:
diff --git a/yab_shop_admin.php b/yab_shop_admin.php
index 1a01734..fed100d 100644
--- a/yab_shop_admin.php
+++ b/yab_shop_admin.php
@@ -297,7 +297,7 @@ function yab_shop_update()
function yab_shop_table_exist($tbl)
{
$tbl = PFX.$tbl;
- $r = mysql_num_rows(safe_query("SHOW TABLES LIKE '".$tbl."'"));
+ $r = mysqli_num_rows(safe_query("SHOW TABLES LIKE '".$tbl."'"));
if ($r)
{
return true;
@@ -790,29 +790,29 @@ function yab_shop_uninstall()
*/
function yab_shop_install($table)
{
- global $txpcfg, $plugins_ver;
+ global $txpcfg, $plugins_ver, $DB;
$yab_shop_version = $plugins_ver['yab_shop_admin'];
- $version = mysql_get_server_info();
+ $version = $DB->version;
$dbcharset = $txpcfg['dbcharset'];
- if (intval($version[0]) >= 5 || preg_match('#^4\.(0\.[2-9]|(1[89]))|(1\.[2-9])#',$version))
+ if (version_compare($version, '5') >= 0 || preg_match('#^4\.(0\.[2-9]|(1[89]))|(1\.[2-9])#', $version))
{
$tabletype = " ENGINE=MyISAM ";
}
else
{
- $tabletype = " TYPE=MyISAM ";
+ $tabletype = " TYPE=MyISAM ";
}
- if (isset($dbcharset) && (intval($version[0]) >= 5 || preg_match('#^4\.[1-9]#',$version)))
+ if (isset($dbcharset) && (version_compare($version, '5') >= 0 || preg_match('#^4\.[1-9]#', $version)))
{
$tabletype .= " CHARACTER SET = $dbcharset ";
if (isset($dbcollate))
{
$tabletype .= " COLLATE $dbcollate ";
}
- mysql_query("SET NAMES ".$dbcharset);
+ mysqli_query($DB->link, "SET NAMES ".$dbcharset);
}
$create_sql = array();
diff --git a/yab_shop_core.php b/yab_shop_core.php
index e8fc015..b58d37d 100644
--- a/yab_shop_core.php
+++ b/yab_shop_core.php
@@ -55,6 +55,22 @@ if (!defined('txpinterface'))
* Version 3: http://www.gnu.org/licenses/gpl-3.0.html
*/
+if (class_exists('\Textpattern\Tag\Registry')) {
+ Txp::get('\Textpattern\Tag\Registry')
+ ->register('yab_shop_cart')
+ ->register('yab_shop_cart_items')
+ ->register('yab_shop_cart_subtotal')
+ ->register('yab_shop_cart_quantity')
+ ->register('yab_shop_cart_message')
+ ->register('yab_shop_cart_link')
+ ->register('yab_shop_checkout')
+ ->register('yab_shop_add')
+ ->register('yab_shop_price')
+ ->register('yab_shop_show_config')
+ ->register('yab_shop_custom_field')
+ ;
+}
+
function yab_shop_cart($atts, $thing = null)
{
extract(
Hope it helps someone.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#858 2017-02-03 02:30:36
Re: yab_shop (simple textpattern shop with paypal support)
Once again, many thanks for your help with this, Bloke!
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
#859 2017-02-09 16:13:07
Re: yab_shop (simple textpattern shop with paypal support)
Thanks Steff for your work, I really appreciate it.
I’ve updated the rest of the plugin to work with TXP 4.6 and PHP 7.1.
- bugfix: TXP v4.6-ready
- bugifx: PHP v7.1-ready
- bugfix: incorrectly formatted item amount when using paypal and promo code
- bugfix: serbian dinar (RSD) know corrcetly shown as »din«
Offline
#860 2017-05-30 19:44:44
- rewQ
- New Member
- Registered: 2011-03-04
- Posts: 5
Re: yab_shop (simple textpattern shop with paypal support)
Hello! TXP 4.6.2, php 5.4. I’ve installed yab_shop, but i see error “user_error specified key was too long max key length is 1000 bytes “ Please, advise where is error?
User_Error “Specified key was too long; max key length is 1000 bytes”
in /home/users/9/—————-/domains/———/textpattern/lib/txplib_db.php at line 409.
adminErrorHandler()
textpattern/lib/txplib_db.php:409 trigger_error()
textpattern/lib/txplib_misc.php(1782) : eval()’d code:968 safe_query()
textpattern/lib/txplib_misc.php(1782) : eval()’d code:192 yab_shop_install()
textpattern/lib/txplib_misc.php(1782) : eval()’d code:89 yab_shop_first_install()
yab_shop_prefs()
textpattern/lib/txplib_misc.php:1895 call_user_func_array()
textpattern/index.php:214 callback_event(
Last edited by rewQ (2017-05-30 20:15:33)
Offline
#861 2017-07-23 06:47:54
Re: yab_shop (simple textpattern shop with paypal support)
IMPORTANT : ITEMS NOT ADDED TO CART
trenc, thanks for the update of the plugin. I have been having serious trouble with this plugin, so just installed your update. Unfortunately this hasn’t solved the issues.
Site: MeijiShowa
ISSUE 1: Item Not Visible in Cart (issue occurs in Safari and Opera)- Add an item to the cart, then view the check out (cart) page. The item displays.
- Continue shopping and add another item. Go to the cart page. The item does not display. (When the page is refreshed it does.)
- Add an item to the cart and view the cart page. The item is not there. Refreshing does not help.
- Add another item and view the cart page. The new item is also not added to the cart.
These issues started after I updated to txp 4.6.2. Previously, yab_shop worked flawlessly.
A client also reported this issue. Since my site was updated this January, all orders have completely stopped… So this is a very serious problem for me.
Can you assist please?
Last edited by Kjeld (2017-07-29 07:44:30)
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
#862 2017-07-28 09:00:29
Re: yab_shop (simple textpattern shop with paypal support)
Continuation of the above post.
I thought that perhaps one of the other plugins interfered. So I tried turning them off and on. But it had no effect on the problems I described in my previous post.
However, I did just notice that if I repeatedly refresh the page in Google Chrome, the items do eventually show in the cart. But I have to hit the refresh key many times. Like 20+…
So, it seems the cart is cached and not easily refreshed. That’s why the items added to the cart do not show up…
Incidentally, I also tested the yab_shop demo shop in all the browsers, and it doesn’t have this issue. So, the origins lie in my set-up, or perhaps —because I didn’t have this problem previously—the latest version of txp?
Any suggestions for fixing this?
Last edited by Kjeld (2017-07-28 09:29:29)
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
#863 2017-07-28 13:03:45
Re: yab_shop (simple textpattern shop with paypal support)
FIXED
I figured out the problem. It was indeed a caching problem. And was caused by an admin setting. So, this means that other people may run into this very same issue.
This is how you solve it:
- Go to Admin : Preferences : Publish
- Set “Send ‘Last-Modified’ header?” to “No”
Last edited by Kjeld (2017-07-28 13:12:50)
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
#864 2017-07-28 13:24:05
Re: yab_shop (simple textpattern shop with paypal support)
The above solution effectively switches off caching for all pages. This means an increase in bandwidth usage and load times.
It seems to me that ideally, the ‘Last-Modified’ header is automatically disabled for the cart page, regardless of the admin setting.
Is this possible?
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline