I was referred to you for help by Michael Visser (www.visser.com.au)
after the following correspondence:
--start--
[01:19:48 PM] Enzo: quick question: is there a way to choose which
product category WPEC uses for breadcrumbs/permalinks?
[01:20:22 PM] Enzo: atm it seems to grab the first (e.g. in wpsc-
functions.php product_categories[0]->slug), which varies depending on
the product
[01:20:35 PM] Enzo: i need it to be from the same category
hierarchy across all the products
[01:21:50 PM] Michael Visser: that's been a beef I've had with
wpec too
[01:22:03 PM] Michael Visser: what line are you looking at within
wpsc-functions.php?
[01:22:39 PM] Enzo: between lines 1099 and 1177 seems to be the
relevant code
[01:22:49 PM] Enzo: but my php is iffy at best
[01:23:16 PM] Enzo: 1083 onward even
[01:23:22 PM] Enzo: wpsc_product_link()
[01:24:39 PM | Edited 01:24:51 PM] Enzo: the site is for selling
wine, so i'd like the structure to read like site.com/product_page/
producer_name/product_page
[01:25:36 PM] Michael Visser: sounds doable
[01:25:38 PM] Enzo: in fact, producer_name is a child category to
'producer', which i don't actually reference directly in any of the
products
[01:25:58 PM] Michael Visser: reading over the code, if you assign
a product to a single category then you've got no problems
[01:26:32 PM] Michael Visser: looks messy, and there's no way to
override it
[01:26:34 PM] Enzo: see, that's the problem - i'm using multiple
categories and reserving tags for something specific
[01:26:48 PM] Michael Visser: yup.
[01:27:08 PM] Michael Visser: thinking of a way around it...
[01:27:49 PM] Michael Visser: there's no easy way, they're always
going to have ugly/wrong category permalinks
[01:27:59 PM] Michael Visser: as it's locking the product to the
first category
[01:28:00 PM] Enzo: a while back i found a plugin that does
exactly what i'm looking for: http://wordpress.org/extend/plugins/hikari-category-permalink/
< the only problem is its functionality doesn't extend to custom post
types (like WPEC's)
[01:28:10 PM] Michael Visser: I guess you could throw in a check
there that says:
[01:28:31 PM] Michael Visser: if you have more than category then
use the current categories slug
[01:28:32 PM] Enzo: (plus i'm not sure if hikari would also
override the breadcrumbs)
[01:30:43 PM] Enzo: i tried to think of a solution earlier:
$parent_cat = 17; // Producers
foreach ( $product_categories as $product_category ) {
if ( $product_category->category_parent == $parent_cat ) {
$link = $childcat->cat_name;
}}
$product_category = $link;
[01:31:02 PM] Enzo: except i don't think category_parent actually
grabs that value and $childcat remains tricky to define
[01:31:05 PM] Michael Visser: same as what I was thinking
[01:31:56 PM] Enzo: i also toyed with a while loop but it got
ugly, usually returning nothing
[01:32:41 PM] Enzo: in category.functions.php there's
wpsc_get_term_parents() which is also interesting
[01:32:57 PM] Enzo: (\wpsc-includes\)
[01:45:32 PM] Michael Visser: raise it with the wpsc-dev list
[01:45:42 PM] Michael Visser: they might be able to hack a patch
for you
[01:46:06 PM] Enzo: can do - link?
[01:46:17 PM] Enzo: getshopped.org/..?
[01:47:14 PM] Michael Visser: wordpress-e-commerce-
plu...@googlegroups.com
[01:47:26 PM] Enzo: good one, thanks
---end---
That pretty much sums it up; any assistance would be much appreciated.
Kind regards,
- Lorenzo
d
--
You received this message because you are subscribed to the Google Groups "WordPress e-Commerce Plugin Development" group.
To post to this group, send email to wordpress-e-commerce-plugin@googlegroups.com.
To unsubscribe from this group, send email to wordpress-e-commerce-plugin+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wordpress-e-commerce-plugin?hl=en.
To post to this group, send email to wordpress-e-c...@googlegroups.com.
To unsubscribe from this group, send email to wordpress-e-commerc...@googlegroups.com.
Control over Category link names for Product Permalinks, e.g.
http://www.domain.com/products-page/[[[category]]]/product-name/
Where a Product belongs to multiple Categories then the first Category off the stack is used as the Category link, without any ordering or priority rules available. Some control over this would avoid confusion over Product Permalinks.
Cheers,
Michael Visser | Visser Labs
http://www.visser.com.au
This email is confidential and may also be privileged. If you are not the intended recipient, please notify me immediately by using my e-mail address above. You should not copy it or use it for any other purpose, nor disclose its contents to any other person. In messages of non-business nature, the views and opinions expressed are the author's own and do not necessarily reflect the views and opinions of Visser Labs.
d
--
You received this message because you are subscribed to the Google Groups "WordPress e-Commerce Plugin Development" group.
To post to this group, send email to wordpress-e-c...@googlegroups.com.
To unsubscribe from this group, send email to wordpress-e-commerc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wordpress-e-commerce-plugin?hl=en.
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1873 / Virus Database: 2101/4635 - Release Date: 11/23/11
On Nov 23, 10:29 pm, "Zao Web Design, LLC" <off...@zaowebdesign.com>
wrote:
> If I'm understanding correctly, it seems that we could probably find an
> elegant enough solution for this - either by attaching priority meta to the
> categories, or by choosing the highest menu order category. With either
> approach, you could specify category priority (either by ordering it higher
> on the category page, or setting priority in meta), and the [0] index key
> would be based on that, rather than on which one was selected first on the
> product.
>
> Thoughts?
>
> Thanks,
>
> *M. Justin Sainton
> Zao Web Design, LLC
> Principal / Project Managerhttp://www.zaowebdesign.com
> (c) 971.222.6330
> (f) 1.413.723.0396*
> >> exactly what i'm looking for:http://wordpress.org/extend/**
> >> plugins/hikari-category-**permalink/<http://wordpress.org/extend/plugins/hikari-category-permalink/>
> >> < the only problem is its functionality doesn't extend to custom post
> >> types (like WPEC's)
>
> >> [01:28:10 PM] Michael Visser: I guess you could throw in a check
> >> there that says:
> >> [01:28:31 PM] Michael Visser: if you have more than category then
> >> use the current categories slug
>
> >> [01:28:32 PM] Enzo: (plus i'm not sure if hikari would also
> >> override the breadcrumbs)
> >> [01:30:43 PM] Enzo: i tried to think of a solution earlier:
>
> >> $parent_cat = 17; // Producers
> >> foreach ( $product_categories as $product_category ) {
> >> if ( $product_category->category_**parent == $parent_cat ) {
> > To post to this group, send email to wordpress-e-commerce-plugin@**
> > googlegroups.com <wordpress-e-c...@googlegroups.com>.
> > To unsubscribe from this group, send email to wordpress-e-commerce-plugin+
> > **unsub...@googlegroups.com<wordpress-e-commerce-plugin%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group athttp://groups.google.com/**
> > group/wordpress-e-commerce-**plugin?hl=en<http://groups.google.com/group/wordpress-e-commerce-plugin?hl=en>
> > .
On Nov 24, 4:42 am, Michael Visser <mich...@visser.com.au> wrote:
> Hi Dan,
>
> Control over Category link names for Product Permalinks, e.g.
>
> http://www.domain.com/products-page/[[[category]]]/product-name/
>
> Where a Product belongs to multiple Categories then the first Category off the stack is used as the Category link, without any ordering or priority rules available. Some control over this would avoid confusion over Product Permalinks.
>
> Cheers,
>
> Michael Visser | Visser Labshttp://www.visser.com.au
> For more options, visit this group athttp://groups.google.com/group/wordpress-e-commerce-plugin?hl=en.
Could someone please offer some code or a plugin/patch? As I said, my
PHP is iffy.
Thanks again for your time/efforts, it's much appreciated.
On Nov 24, 10:47 am, "Zao Web Design, LLC" <off...@zaowebdesign.com>
wrote:
> That's a bit edge case, as it wouldn't be resolved by the initial original
> argument of choosing which (of multiple) categories a project should
> utilize from a URL, nor would it be resolved by the new hierarchical
> permalinks options
>
> Sounds to me like we should probably filter by term order, and potentially
> filter the category with parameters that at least include the $product_id
> and $term_id, so a plugin could filter it and do what Enzo is requiring.
> That said, Enzo, you should probably be categorizing the products in the
> category they are intended to be in (If they are in a "Producer Names"
> category, don't just select the parent, "Producer", make sure they are in
> "Producer Names").
>
> Thanks,
>
> *M. Justin Sainton
> Zao Web Design, LLC
> Principal / Project Managerhttp://www.zaowebdesign.com
> (c) 971.222.6330
> (f) 1.413.723.0396*
>
I've added the line to wpsc-functions.php (as specified) now what's
the best way to reference it to ensure that the specified category
(esp. it's child subsets) are given sorting priority in permalinks/
breadcrumbs?
On Nov 24, 11:36 am, "Zao Web Design, LLC" <off...@zaowebdesign.com>
wrote:
> Yeah, I wouldn't necessarily use that function.
>
> What I'd probably do to keep core nice and light is, around Line 1220
> (right before the $rewritereplace array is created), add the following line
> -
>
> $category_slug = apply_filters( 'wpsc_product_permalink_cat_slug',
> $category_slug, $post_id );
>
> Then, write a plugin that hooks into that. Check if the $post_id is in
> your specific category, and if so, return the category slug you're needing.
>
> Easy enough?
>
> Thanks,
>
> *M. Justin Sainton
> Zao Web Design, LLC
> Principal / Project Managerhttp://www.zaowebdesign.com
> (c) 971.222.6330
> (f) 1.413.723.0396*
>
> ...
>
> read more »
> ...
>
> read more »
> ...
>
> read more »
--
You received this message because you are subscribed to the Google Groups "WordPress e-Commerce Plugin Development" group.
Incidentally, I looked at possibly reworking the site to have a single
category for products and it goes against what I'm trying to
accomplish, so a solution here would still be first prize.
If anyone feels like contributing an answer, I'm all ears.
On Nov 24, 9:51 pm, "Zao Web Design, LLC" <off...@zaowebdesign.com>
wrote:
> It's Thanksgiving here in the States ;) Probably won't get a peep this
> side of the world until Monday. You may have better luck commissioning one
> of the consultants listed at GetShopped to develop the solution for you
> (and submit a patch to the core team to ensure future compatibility).
>
> Thanks,
>
> *M. Justin Sainton
> Zao Web Design, LLC
> Principal / Project Managerhttp://www.zaowebdesign.com
> (c) 971.222.6330
> (f) 1.413.723.0396*
>
> ...
>
> read more »
> ...
>
> read more »
--start--
Only Show Children of a Category
The following example code generates category links, sorted by ID,
only for the children of the category with ID 8; it shows the number
of posts per category and hides category descriptions from the title
attribute of the generated links. Note: If there are no posts in a
parent Category, the parent Category will not display.
<ul>
<?php
wp_list_categories('orderby=id&show_count=1&use_desc_for_title=0&child_of=8'); ?
>
</ul>
---end---
Perhaps as an alternative category reference for the permalink/
breadcrumb structures?..
On Nov 24, 11:36 am, "Zao Web Design, LLC" <off...@zaowebdesign.com>
wrote:
> Yeah, I wouldn't necessarily use that function.
>
> What I'd probably do to keep core nice and light is, around Line 1220
> (right before the $rewritereplace array is created), add the following line
> -
>
> $category_slug = apply_filters( 'wpsc_product_permalink_cat_slug',
> $category_slug, $post_id );
>
> Then, write a plugin that hooks into that. Check if the $post_id is in
> your specific category, and if so, return the category slug you're needing.
>
> Easy enough?
>
> Thanks,
>
> *M. Justin Sainton
> Zao Web Design, LLC
> Principal / Project Managerhttp://www.zaowebdesign.com
> (c) 971.222.6330
> (f) 1.413.723.0396*
>
> ...
>
> read more »
Much appreciated.
http://getshopped.org/forums/topic/specifying-breadcrumbpermalink-category-hierarchy/
and here:
to no avail. Please keep me posted.
On Nov 29, 9:17 am, "Zao Web Design, LLC" <off...@zaowebdesign.com>
wrote:
> I'll pipe in for him, as it's after work hours where Dan's at - and he
> wouldn't be able to help on a technical question like this :).
>
> wp_list_categories isn't what you'd want here. While you can use it with
> custom taxonomies, the primary purpose of the function is presentational -
> it would be overkill and inappropriate based on what you're needing to do.
>
> As I mentioned before, your best bet is to petition the core team
> (currently myself, Gary Cao and Michelle) for the filter I mentioned and
> write a plugin (or commission someone to write a plugin) to utilize that
> filter to switch the category slug for a particular product or array of
> products. Seems like a reasonable enough filter to add, I wouldn't be
> opposed.
>
> Thanks,
>
> *M. Justin Sainton
> Zao Web Design, LLC
> Principal / Project Managerhttp://www.zaowebdesign.com
> (c) 971.222.6330
> (f) 1.413.723.0396*
>
Thanks again for the help.
On Nov 29, 10:49 am, "Zao Web Design, LLC" <off...@zaowebdesign.com>
wrote:
> The forums on GetShopped are primarily community-driven - if there isn't a
> response there, it's because there was no traction from anyone there. And
> no one really looks at the Stack Exchange site for stuff like this.
>
> I'll look up my previous email in the morning and apply the necessary
> filter - it will be in your hands from there ;) That all said, it could be
> easily argued that you could fix the entire situation by not having the
> parent categories (Producer) at all...those could be converted to tags, and
> categories could be strictly limited to hierarchical constructs you'd like
> in the URL.
>
> But that's a separate discussion :)
>
> Thanks,
>
> *M. Justin Sainton
> Zao Web Design, LLC
> Principal / Project Managerhttp://www.zaowebdesign.com
> (c) 971.222.6330
> (f) 1.413.723.0396*
>
> On Tue, Nov 29, 2011 at 12:41 AM, Enzo <loren...@gmail.com> wrote:
> > That would be great. Is there anything required from my part for the
> > 'petitioning'? I've also tried asking for help here:
>
> >http://getshopped.org/forums/topic/specifying-breadcrumbpermalink-cat...
>
> > and here:
>
> >http://wordpress.stackexchange.com/questions/34915/wpec-specifying-br...
On Nov 29, 11:58 am, "Zao Web Design, LLC" <off...@zaowebdesign.com>
wrote:
> Alright, you're all set, as of revision 1400 -http://code.google.com/p/wp-e-commerce/source/detail?r=1400
>
> Thanks,
>
> *M. Justin Sainton
> Zao Web Design, LLC
> Principal / Project Managerhttp://www.zaowebdesign.com
> (c) 971.222.6330
> (f) 1.413.723.0396*
>
On Nov 29, 11:58 am, "Zao Web Design, LLC" <off...@zaowebdesign.com>
wrote:
> Alright, you're all set, as of revision 1400 -http://code.google.com/p/wp-e-commerce/source/detail?r=1400
>
> Thanks,
>
> *M. Justin Sainton
> Zao Web Design, LLC
> Principal / Project Managerhttp://www.zaowebdesign.com
> (c) 971.222.6330
> (f) 1.413.723.0396*
>
> > > >http://getshopped.org/forums/topic/specifying-breadcrumbpermalink-cat.
> > ..
>
> > > > and here:
>
> > > >http://wordpress.stackexchange.com/questions/34915/wpec-specifying-br.
> > ..
>
Seems at this point it's best to go back to the Consultants list on GetShopped.org, with Justin's change the category slug can now be overridden in a simple Plugin. Thanks Justin.
http://getshopped.org/resources/wp-consultants/
We're doing our best to assist and this conversation is now a support issue, not a feature request and should be continued in the Forums or via Consultants. Cheers to Justin for making that change. Thanks guys.
Cheers,
Michael Visser | Visser Labs
http://www.visser.com.au
This email is confidential and may also be privileged. If you are not the intended recipient, please notify me immediately by using my e-mail address above. You should not copy it or use it for any other purpose, nor disclose its contents to any other person. In messages of non-business nature, the views and opinions expressed are the author's own and do not necessarily reflect the views and opinions of Visser Labs.
-----Original Message-----
From: wordpress-e-c...@googlegroups.com [mailto:wordpress-e-c...@googlegroups.com] On Behalf Of Enzo
Sent: Tuesday, 29 November 2011 7:05 PM
To: WordPress e-Commerce Plugin Development
Subject: Re: wordpress-e-commerce-plugin specifying wpec's breadcrumb/permalink category hierarchy
Recommendations?.. There are -so many- and their forum has been
useless so far:
http://getshopped.org/forums/topic/specifying-breadcrumbpermalink-category-hierarchy/
On Nov 29, 1:23 pm, Michael Visser <mich...@visser.com.au> wrote:
> Hi Enzo,
>
> Seems at this point it's best to go back to the Consultants list on GetShopped.org, with Justin's change the category slug can now be overridden in a simple Plugin. Thanks Justin.
>
> http://getshopped.org/resources/wp-consultants/
>
> We're doing our best to assist and this conversation is now a support issue, not a feature request and should be continued in the Forums or via Consultants. Cheers to Justin for making that change. Thanks guys.
>
> Cheers,
>
> Michael Visser | Visser Labshttp://www.visser.com.au
> ...
>
> read more »
I agree with you and I'm happy to proceed as you say.
My only frustration is that there's no way of specifying the first
category, it's simply taken from the first alphabetically sorted slug
value across all the different product categories and therefore varies
from post to post.
I am still in disbelief that WPEC's core doesn't have a the option in
WP's admin to assign priority to categories for this purpose;
especially when this type of feature has been present in so many CMS's
(e.g. drupal) for years!
I'm not looking to hack the core, I'm happy to leave the wpec-
functions.php as clean as possible. What I am asking for is either to
have the WPEC plugin updated to cater for this (surely intuitive)
feature or for someone to recommend me to an individual who may be
able to assist me in developing a plugin that will do this.
The only alternative (it seems) is to have one type category across
all the products and to migrate all the other categories to tags
instead, which doesn't work for what I'm attempting to do because I
wish to preserve the categories as a hierarchically sorted navigation
in the sidebar.
Also, what I've mentioned before is that I am not a PHP coder, I
simply modify the code I find to achieve the desired effect. Talk of
custom taxonomies and linking me to sites that elaborate on that is
way over my head.
Bottom line: please can someone refer me to someone that can help me
write a plugin that will accomplish my request? I don't wish to waste
anyone's time that isn't interested in doing so.
Thanks again.
On Nov 29, 1:51 pm, Agus MU <agus...@gmail.com> wrote:
> Dear Enzo,
>
> Please understand that it is Plugin Development group, not for discussing a
> deep customization topic. So, yes, it is better to follow Michael Visser
> suggestion to contact one of WP consultant here,http://getshopped.org/resources/wp-consultants/
>
> For me, it is all about decision. When working with post category and
> product category taxonomy where they support "multiple" categories, we have
> to decide what category that will be used for permalink / breadcrumb...
> And what WPEC do is simple and perfect for most of WPEC users. You can see
> similar approach at other themes/plugins, for example breadcrumb class
> function from Genesis Framework also choose the first category when a post
> has multiple categories. So, it is natural... :)
>
> I am a developer, but also a user, so hacking core plugin code is not
> recommended here, because you will get more troubles when you try to update
> your plugin. So, I always try to find the simple way to get what I want,
> without hacking the core plugin.
>
> So, when I saw your first email here, I thought the simple way to get what
> you wantt, you can use "Producer Name" as your parent category! No need to
> add "Producers" parent category here. And don't use multiple category for
> all of your products! One producer name for one product... That's simple...
>
> Your next question: But, I want to add different category group to my
> products, let's say "Brands", "Country", "Genre", etc...? The elegant
> solution is adding custom taxonomy for every category groups above!http://codex.wordpress.org/Function_Reference/register_taxonomy
>
> So, you can extend your WPEC capability without hacking any WPEC plugin
> code!!!
>
> Just my two cents to make your problem looks easy...
>
> Best Regards,
> Agus
>
> ...
>
> read more »
I've written to a few of the developers and now I'm waiting to see if
anyone replies.
On Nov 29, 2:29 pm, Agus MU <agus...@gmail.com> wrote:
> Hello Enzo,
>
> I can't recommend anyone here because I don't have any experience with
> them, if you want to try, you can contact most of developers here and ask
> their quotes.http://getshopped.org/resources/wp-consultants/developers
>
> Could you send your website URL to me? I would love to give you some
> suggestions when I can see it.
>
> Thanks,
> Agus
>
> ...
>
> read more »
Please star the Google Code topic and bump the Support Forum topic, else try the Consultants list again.
This is a Core focussed mailing list, now that Justin's patch has been created this is now a support issue and should be followed up via the Support Forum or Consultants list. In time this feature may be further developed but these guys are being kept very busy with releases and as such a third-party solution which will need to be developed for your site from the below sources. Hope this helps.
http://getshopped.org/resources/wp-consultants/
Cheers,
Michael Visser | Visser Labs
http://www.visser.com.au
This email is confidential and may also be privileged. If you are not the intended recipient, please notify me immediately by using my e-mail address above. You should not copy it or use it for any other purpose, nor disclose its contents to any other person. In messages of non-business nature, the views and opinions expressed are the author's own and do not necessarily reflect the views and opinions of Visser Labs.
-----Original Message-----
From: wordpress-e-c...@googlegroups.com [mailto:wordpress-e-c...@googlegroups.com] On Behalf Of Enzo
Sent: Tuesday, 29 November 2011 8:21 PM
To: WordPress e-Commerce Plugin Development
Subject: Re: wordpress-e-commerce-plugin specifying wpec's breadcrumb/permalink category hierarchy
Hello Agus,
Thanks again.
--
Actually I do not see this as being suitable for the forums since it is a request for work.
The core team is busy working on the next release of the WP e-Commerce Plugin and as such we're not taking on new features right now. That said we are totally happy to add new hooks and filters (which we've done for you) if it helps make the WP e-Commerce Plugin even more extendible. This is the WordPress way :))
I agree with Visser and I think that at this point you need to be finding / commissioning a developer to make this into a Plugin.
Best,
Dan
No worries - I took the advice to look up a developer and succeeded
with Lee Willis (http://www.leewillis.co.uk/) - he was able to help me
with this by creating a 'Permalink Forcer' plugin that hooks into wpsc-
functions.php (revision 1400).
Thank you guys for your input and I'm relieved to have sorted this out
in the end.
Cheers,
- Lorenzo
> ...
>
> read more »
If you submit the Plugin here: http://getshopped.org/fpt-plugins/
Then other members of our community will also benefit from this.
Best,
Dan
>> read more �
read more »
--
You received this message because you are subscribed to the Google Groups "WordPress e-Commerce Plugin Development" group.
To post to this group, send email to wordpress-e-commerce-plugin@googlegroups.com.
To unsubscribe from this group, send email to wordpress-e-commerce-plugin+unsub...@googlegroups.com.