Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#301 2009-05-20 03:23:54
- kevinpotts
- Member
- From: Ghost Coast
- Registered: 2004-12-07
- Posts: 370
Re: yab_shop (simple textpattern shop with paypal support)
Just a quick question: just upgraded from 0.5.2 to 0.7.0. Updated all my tags and templates, and things seem to be working fine. However, in the checkout page, I cannot remove items from the shopping cart. neither the “X” nor the “Change Quantity” buttons work. If you go here and add a copy to your cart, then go to checkout, you’ll see what I mean. Am I missing something obvious?
Kevin
(graphicpush)
Offline
#302 2009-05-20 03:46:48
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: yab_shop (simple textpattern shop with paypal support)
kevinpotts wrote:
Just a quick question: just upgraded from 0.5.2 to 0.7.0. Updated all my tags and templates, and things seem to be working fine. However, in the checkout page, I cannot remove items from the shopping cart.
Hi Kevin,
I had the same problem immediately after an upgrade from 0.6.2 (I think) to 0.70 but after a few attempts it started working OK. I’ve just checked & it’s still working for me. Can’t persuade your checkout to behave though. Not much help I’m afraid!
Adi
Offline
#303 2009-05-22 14:22:16
Re: yab_shop (simple textpattern shop with paypal support)
Hi kevinpotts,
Just a quick question: just upgraded from 0.5.2 to 0.7.0. Updated all my tags and templates, and things seem to be working fine. However, in the checkout page, I cannot remove items from the shopping cart. neither the “X” nor the “Change Quantity” buttons work.
With version 0.7.0 you have to place <txp:yab_shop_cart />
somewhere in your checkout section. If want no cart output use it with the attribute output=“none”: <txp:yab_shop_cart output="none" />
.
Last edited by trenc (2009-05-22 14:23:41)
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
#304 2009-05-22 14:31:24
Re: yab_shop (simple textpattern shop with paypal support)
Hi Adi,
<txp:yab_shop_if_free_shipping>
Congratulations you've qualified for free shipping.
<txp:else/>
If you spend XX or more shipping is free.
</txp:yab_shop_if_free_shipping>
Hm, nice idea, but you can do this (by now) with smd_if and your adi_calc. :)
Also, a nice way of getting config settings into articles would be great. At the moment all I can think of is, for example:
Yes, next version will include a function for returning config settings.
Last edited by trenc (2009-05-22 14:32:53)
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
#305 2009-05-22 18:11:17
- kevinpotts
- Member
- From: Ghost Coast
- Registered: 2004-12-07
- Posts: 370
Re: yab_shop (simple textpattern shop with paypal support)
With version 0.7.0 you have to place
<txp:yab_shop_cart />
somewhere in your checkout section. If want no cart output use it with the attribute output=“none”:<txp:yab_shop_cart output="none" />
.
Brilliant. Worked perfectly. What is the logic behind this?
Kevin
(graphicpush)
Offline
#306 2009-05-24 10:13:18
Re: yab_shop (simple textpattern shop with paypal support)
I’ve replaced some functions, so that the cart can be showed easily in checkout section too, if wanted. With the functions before the cart output does not work properly in the checkout section. But now it does and additionally the source code is al little bit reduced. :)
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
#307 2009-05-27 14:07:59
- amoensia
- New Member
- Registered: 2009-03-16
- Posts: 2
Re: yab_shop (simple textpattern shop with paypal support)
Thank you so much for the addition of PhP for the currencies! I’m using your plugin for my eCommerce thesis.
I have a question though, I’m not well versed in PHP but I’m wondering how I would validate the form fields? For example, the Phone number will be considered invalid if I enter letters and less than 7 numbers.
And another question, the currency I’m using is not supported by PayPal, so when I check out, Php 11.00 becomes $ 11.00 in PayPal. Is there any way that the plugin will convert the amount to a specified rate before forwarding it to PayPal?
This is the address for my thesis. www.paperilla.net
Thank you for any help!
Last edited by amoensia (2009-05-27 14:46:21)
Offline
#308 2009-06-01 03:43:13
- darkos
- New Member
- From: Texas, US
- Registered: 2009-06-01
- Posts: 2
Re: yab_shop (simple textpattern shop with paypal support)
Tag error: <txp:yab_shop_add /> -> Textpattern Warning: tag does not exist on line 1104
I installed yab_shop plugin
- yab_shop_core_v0.7.0.txt
- yab_shop_config_v0.7.0.txt
- yab_shop_3rd_party_v0.7.0.txt
I created new section ‘store’
Also, I set this in config:
‘checkout_section_name’ => ‘store’
I created few articles and assigned them to ‘store’ section
Regardless if I put “<txp:yab_shop_add />” in my article or in the form, i get that tag error:
Tag error: <txp:yab_shop_add /> -> Textpattern Warning: tag does not exist on line 1104
Please help…
A little about my journey to the textpattern:
I found textpattern as the most intelligent package that fits all my needs for web site implementation and i was very happy finding this plugin for PayPal Payment Processing, but before that…
I developed few solutions with RoR (ruby on rails and it was ok, xcept it was a little slow…)
Than I refactored one RoR implementation in PHP trying ot use jquery for Ajax and learned painfull truth about PayPal session concurency…so I gave it up and…
Found ZenCart (gave up on Ajax for a while and set up my dev shop in ZwnCart…)ZenCart is to complicated and while I was implementing my shop, I found TextPattern and yab_shop.
I have no idea how TextPattern and It’s plugins are working together…i followed (i think) instructions about how to install yab_shop and I was able to install it.
Plugin help is for people who are very familiar with textpattern and plugins.
Could someone, who already set simple shop seccesfully, post a “Dummie Tutorial”:
example:
1. Create new section ‘store’
2. Create new Article Product_One and assign it to section store (do this for several products)
3. Create new page and…
4. Create custom field (if you do not know how, here’s a link ‘How To Create Custom Field’)
…
…
9. Place this tag <txp:yab_shop_add /> in ….
…
13. If you get this error: Tag error: <txp:yab_shop_add /> -> Textpattern Warning: tag does not exist it is because…
If this is too much, please write “simple steps – how to set up yab_shop with 3 products” so people like me can follow and reply so we make a tutorial that will end up as video-tutorial.
Thanks a lot for any help.
Offline
#309 2009-06-01 10:50:22
Re: yab_shop (simple textpattern shop with paypal support)
I’m putting this plugin into a client area of a web site and it really rocks. Thanks for the amazing amount of work you’ve put into it, trenc.
I have a handful of questions that I haven’t spotted in the thread so far:
1) Is it possible to add a class
attribute to the yab_shop_price field? I want to use some javascript like the one from your Nice House page for auto-updating the price field based on the variant chosen and its quantity. Your version specifically targets the ID of the price, which is fine but I’d like to use my own js in a form across all product pages. At the moment I’m using:
<script type="text/javascript">
var base_price = "<txp:custom_field name='price' />";
jQuery(function() {
jQuery("#select-variant").change(function () {
jQuery("#select-variant option:selected").each(function() {
var str = jQuery(this).text().match(/: /) ? jQuery(this).text().replace(/.*: /, "") : base_price;
jQuery(".price span").text(str);
})
})
});
</script>
which mimics yours (for now), but the jQuery(".price span")
would stop working if you ever change the markup inside the price field. A dedicated class that I could swing the jQuery off would make me feel a little warmer and fuzzier inside :-) And if your javascript could be optional via some tag attribute switch it would stop clashes for those of use that would like to do something a little different?
2) Can I add the variant name in an arbitrary location within the product description in the cart and the checkout? At the moment I see in my yab_shop_cart:
Widget
Price: £50
Quantity: 1
Widget
Price: £100
Quantity: 1
Widget
Price: £150
Quantity: 1
What would be better might be:
Widget (paper)
Price: £50
Quantity: 1
Widget (plastic)
Price: £100
Quantity: 1
Widget (metal)
Price: £150
Quantity: 1
or something like that. Is it perhaps possible to use yab_shop_cart_items as a container so I can format the list using other yab_shop tags? Perhaps the same on the checkout page (although that’s less important because the variant is listed already underneath)? Maybe another tag <txp:yab_shop_cart_property name="material" />
could output the selected variant?
3) Can you see any clever way I could use promo codes per client? We have tiers of partners we work with: for example, we assign trusted partners whom we’ve known for ages or who always buy in bulk a “gold” promo code, others get “silver” and a few get “bronze”. Some we might even have special, dedicated promo codes for.
We set up the client logins manually and configure their initial details like company name, street address, email, what promotion level they receive, and so on. When a client logs in (ign_password_protect governs the login system) I’ll read their promo code from the database and would like to set — perhaps via a txp:variable — their promo code/discount and then automatically apply that code to their purchases.
At the moment the promos are hard-coded in yab_shop_config. My initial stab at making them dynamic might be, e.g:
'promocode' => $variable['client_promocode'],
'promo_discount_percent' => $variable['client_discount'],
or, perhaps with some suitable mods on your part, allow a syntax like this:
'promocode' => 'txpvar:client_promocode',
'promo_discount_percent' => 'txpvar:client_discount',
which would essentially do the same thing as the 1st idea without me having to manually add global $variable
to the yab_shop_config()
function.
Do you see any issue with doing this? Would it work? Can I automatically apply this code without them having to type it into a box on the screen? Do you have any better ideas on how to achieve this?
4) I’d like to auto-fill in the boxes at the bottom of the checkout form with relevant client info. Sure, they’d be “remembered” second time round if the client ticks the box on their 1st order, but I’d like it in there first time as well. I would prefer to hide the ‘remember’ checkbox so the values are always read from the ign user table and can simply be edited. The clients will be able to update their own details (via mem_self_register’s Profile Edit feature) so their details might change from time to time.
Any ideas on any of the above greatly appreciated. This plugin really is awesome and makes adding ecommerce to TXP a breeze.
Last edited by Bloke (2009-06-01 13:00:58)
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
#310 2009-06-01 11:21:10
Re: yab_shop (simple textpattern shop with paypal support)
darkos wrote:
Tag error: <txp:yab_shop_add /> -> Textpattern Warning: tag does not exist on line 1104
Out of curiosity, have you enabled the plugins on the Admin->Plugins tab? Look at the Active column and check that all three say “Yes”.
Could someone, who already set simple shop seccesfully, post a “Dummie Tutorial”:
Well, I’ve done it this morning and I’m no expert, but this is what I did:
1. Clone the default Page template and call it shop
2. Create new Section ‘shop’, assign it the Page ‘shop’
3. Create new Section ‘checkout’ and also assign it to the ‘shop’ Page (might not need both sections, but I couldn’t get it to work otherwise)
4. In Admin->Prefs->Advanced, name a custom field Price
5. Edit yab_shop_config and set up the parameters. Specifically the custom_field_price_name
, checkout_section_name
(=> checkout), tax and currency info
6. In the flow of the Page template “shop”, wherever you’d like the item info/checkout to appear (this probably replaces the existing <txp:article />
tag):
<txp:if_section name="shop">
<txp:output_form form="shop_sidebar" />
<txp:article form="shop_item" />
<txp:else />
<h3>Checkout</h3>
<txp:yab_shop_cart output="none" />
<txp:yab_shop_checkout />
</txp:if_section>
7. Create a new Form called shop_item
and put this in it:
<h3><txp:title /></h3>
<txp:article_image wraptag="div" class="shop_pic" />
<txp:body />
<div class="shop_info">
<p class="price">Price: <txp:yab_shop_price /></p>
<txp:yab_shop_add />
</div>
8. Create a new form called shop_sidebar
and put this in it:
<h3>Your cart</h3>
<txp:yab_shop_cart>
<txp:yab_shop_cart_items />
<txp:yab_shop_cart_message />
</txp:yab_shop_cart>
9. Create a new Article called Product_One and assign it to section ‘shop’. Make sure you fill in the Price custom field
10. Repeat step 9 for several products
11. View site.com/shop and edit the Style rules to make it look pretty
I think that’s about it. Hope I’ve not missed anything. There’s probably a much better way to do it, but that’s working for me so far. I haven’t looked at the ‘list’ part of the shop Page template yet (listing products in one page and allowing you to leaf through the pages) but that’s probably just a case of adding <txp:if_article_list>
and corresponding <txp:article />
/ <txp:older />
and <txp:newer />
tags.
Hope that helps.
Last edited by Bloke (2009-06-01 11:33:23)
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
#311 2009-06-02 04:30:24
- darkos
- New Member
- From: Texas, US
- Registered: 2009-06-01
- Posts: 2
Re: yab_shop (simple textpattern shop with paypal support)
A Thousand Thank You
Out of curiosity, have you enabled the plugins on the Admin->Plugins tab? Look at the Active column and check that all three say “Yes”.
First bingo ! I had only two, and than i remembered that I had read somewhere … use compressed plugin files if you had any problems. So I reinstalled and things started getting better.
I think that’s about it. Hope I’ve not missed anything.
Looks like your “Dummy tutorial” is rather useful. I thought You missed something, but at the end, it was an “user error” -:).
Anyway, all “problems” I have now are related to me being inexperienced TextPattern user and I am working on my experience right now… like:
Make sure you fill in the Price custom field
I will make sure but first need to learn how… -:) …and I did…I edited this reply 4 times. Every time after I would learn smtg and make it working…
Thank you again for “yab_shop” baby steps.
p.s.
After I set up my shop, I will document it and post it here (together with a link to a screencast)
Last edited by darkos (2009-06-02 05:27:26)
Offline
#312 2009-06-03 09:43:55
Re: yab_shop (simple textpattern shop with paypal support)
Hi amoensia,
I have a question though, I’m not well versed in PHP but I’m wondering how I would validate the form fields? For example, the Phone number will be considered invalid if I enter letters and less than 7 numbers.
adding a validation for a phone number is not trivial. Example: Will be the 7 numbers include a withspace, minus or slash as delimiter or not? You can not foresay what valid format the user will put in the phone field. In addition this field is optional and can used with another label (f.i. »Company«), so my recommendation is: Trust the intelligence of the user to give you a proper phone number input!
And another question, the currency I’m using is not supported by PayPal, so when I check out, Php 11.00 becomes $ 11.00 in PayPal. Is there any way that the plugin will convert the amount to a specified rate before forwarding it to PayPal?
No, sorry. If the plugin would do this, so the plugin would need a daily or hourly official exchange rate to calculate the dollar or, as a minimum, a fixed exchange rate. If you are using Paypal I recommend an usage of a currency supported by Paypal.
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline