Author Topic: HACK: AutoGen Metadata Metatag. Product, Category. Title, Description, Keywords  (Read 230192 times)

Forrest

  • Hero Member
  • *****
  • Posts: 1972
  • Me and my baby
    • Web Developer
The meta-forms are found in the add/edit product pages or add edit category pages. In Joomla admin, go to the Virtuemart Component. Once in the VM component, on the left side there is a menu. You will see "Products", and under products you will see "List Products" or "Add Product". If you click on Add Product, you will see the form on the first tab that pops up.

Same goes for categories... "Add Category", first tab that appears.

Components -> Virtuemart -> Products -> Add Product
Components -> Virtuemart -> Products -> Add Category

or

Components -> Virtuemart -> Products -> List Products -> SELECT YOUR PRODUCT
Components -> Virtuemart -> Products -> List Categories -> SELECT YOUR CATEGORY

joenist99

  • Beginner
  • *
  • Posts: 3
I use Virtuemart 1.1.3 + autogen_metatags_vm1.14_v1.1

on the first time i get repeating url for my livesite  ???
ex: http://www.juraganbatik.com/www.juraganbatik.com?page=shop.product_details&flypage=flypage.tpl&product_id=3&category_id=5

i edited shop.browse.php in line-574 
Code: [Select]
$url = $sess->url( $mm_action_url.'?'.$url_parameters );to
Code: [Select]
$url = $sess->url( $url_parameters );and my livesite can run normaly  ;D

now autogen_metatags_vm1.14_v1.1 -> tested in Virtuemart 1.1.3 stable  :-*
thanks to A.K.A forrest you are the best  ;)

Forrest

  • Hero Member
  • *****
  • Posts: 1972
  • Me and my baby
    • Web Developer
Thanks for the update and 1.1.3 solution joenist99 :)

anticubestudios

  • Beginner
  • *
  • Posts: 1
Hey, Mate,

Excellent hack, thanks for your good work!

The products work like a champ, but I can't for the life of me get the categories to work properly.

Here's a link to a product:
http://www.dynamicbizsupplies.com/hasler/15-hasler-ink-cartridges/17-pppinkr-2-ink-cartridges

And it's parent category:
http://www.dynamicbizsupplies.com/hasler/15-hasler-ink-cartridges

You can see that the title isn't appended, even though I've checked the DB settings. I've even gone into your code in shop.browse and added debug statements. It's calling $document->setTitle() from the right place, but the title isn't changing.

I'm curious if this has anything to do with SEF redirects being enabled..? I don't really know. It seems strange that it's getting to the appropriate lines of code and they're not really doing anything.

Any thoughts?

Cheers,
Matt

Forrest

  • Hero Member
  • *****
  • Posts: 1972
  • Me and my baby
    • Web Developer
Did you clear your Joomla cache? Please make sure the manual edit override box is NOT checked for categories.

SEF should have nothing to do with this. I have SEF running fine.

Your discription is coming up blank as well. Did you remove this code?

Did you use the files I included in the hack, or did you copy the code and put it into your original files? If so, did you comment out the title and description from the original files?

What version of VM and Joomla please?

swacks

  • Beginner
  • *
  • Posts: 13
hello -

i would like to see my parent category and child category in the title before the product.

i followed the instruction and i thought this would happen like it does on your site , but it doesnt happen on mine



http://www.tonerandink.co.za/index.php?option=com_virtuemart&page=shop.browse&category_id=1403&Itemid=47

that should be Lexmark Paper in title but it just says paper

thanks in advance!

Forrest

  • Hero Member
  • *****
  • Posts: 1972
  • Me and my baby
    • Web Developer
1. First, the link you sent me was for a category, not a product.

2. Looking at the category however, it should have something like "Lemark - Paper", where your's only has "Paper". PLEASE MAKE SURE YOU HAVE UNCHECKED:
* Turn On Manual Edit of Meta Title/Description/Keywords (Global)
within any category edit page.
AND MAKE SURE YOU HAVE CHECKED
* Append PARENT Category Name to Title and Description Metatag (a Globla setting)

3. As for your products pages: On my site, and the way I have the hack set up, the CATEGORY is only APPENED, not PREPENDED, in the title of the product. In other words, unless you hack my hack, you can only add Category AFTER the product name. To make this work MAKE SURE YOU HAVE CHECKED:
* Append Category Name to Title and Description Metatag (a Global setting)
within any product edit page.

swacks

  • Beginner
  • *
  • Posts: 13
Quote
UNCHECKED:
* Turn On Manual Edit of Meta Title/Description/Keywords (Global)
within any category edit page.


YES I LEFT IT UNCHECKED

Quote
AND MAKE SURE YOU HAVE CHECKED
* Append PARENT Category Name to Title and Description Metatag (a Globla setting)


the problem is that it does not save!

thnx
I CHECK this but when i save it remains UNCHECKED ???

Forrest

  • Hero Member
  • *****
  • Posts: 1972
  • Me and my baby
    • Web Developer
K, I'll look into it now.

Forrest

  • Hero Member
  • *****
  • Posts: 1972
  • Me and my baby
    • Web Developer
While I'm doing that can you tell me a few things.

1. Does the append category check box work for products (does it save checked)?

2. Are other check boxes/variables in the category form saving? In other words, can you check the other boxes, or make edits to the fields in all other category meta options?


This would help me troubleshoot. Thanks.

swacks

  • Beginner
  • *
  • Posts: 13
Thanks Forrest ,

I tried for both categories and products:

Append Category Name to Title and Description Metatag: DOESNT SAVE   

Turn On Manual Edit of Meta Title/Description/Keywords (Global): DOESNT SAVE

insert of text does not save either

thnx !

demsey

  • Beginner
  • *
  • Posts: 7
Hi,

Thank you Forrest for that great hack.

I have found a few problems.

Quote
D. The system comes with a word filter (like a bad word filter) so you can exclude words you know you do not want in your keywords (like, the, of, for, if). I have included a fairly extensive set already.

That filter doesn't want to remove first word from product short description. If I have a word in my product short description which I don't want to have with my keywords that filter can't do it. I tried to fix that but I couldn't. But I used a hack.

From this
Code: [Select]
$get_words = ucwords(strip_tags($desc.' '.$category_has_parent_description.' '.$product_names_list));
To that
Code: [Select]
$get_words = ucwords(strip_tags("xx" . $desc.' '.$category_has_parent_description.' xx '.$product_names_list));
So first word in get_words array will be "xx" and the script will remove that anyway because it is too short so I don't have to worry and filter will exclude the first word from product description.

Second problem is $general_append_keys. If I have a phrases (2 or 3 words) that script will split all of them to single keywords. I think it could be better if I have not just single keywords but also some phrases. So this is what I changed:

From
Code: [Select]
$end_result = strtolower($trimmed_title.', '.$trimmed_words.', '.$general_append_keys);To
Code: [Select]
$end_result = strtolower($trimmed_title.', '.$trimmed_words);
And added extra line after
Code: [Select]
$unique = str_replace(' ', ', ', $unique);
$unique = str_replace(',,', ',', $unique);

$unique = $unique . ", " .$general_append_keys; //an extra line
Now I have some keywords created from my product description + some phrases which I have added to database manually.

I also removed $general_append_end from title because it creates too long title.

Same changes for both files (shop.browse.php and shop.product_details.php).


I would like to fix the first problem.

Forrest

  • Hero Member
  • *****
  • Posts: 1972
  • Me and my baby
    • Web Developer
SWACKS
Quote
Thanks Forrest ,

I tried for both categories and products:

Append Category Name to Title and Description Metatag: DOESNT SAVE   

Turn On Manual Edit of Meta Title/Description/Keywords (Global): DOESNT SAVE

insert of text does not save either

thnx !

Sounds to me like you either didn't run the SQL, or that you didn't copy over a few files/necessary code. Please review more carefully!

Forrest

  • Hero Member
  • *****
  • Posts: 1972
  • Me and my baby
    • Web Developer
DEMSEY

Thanks for the insightful post. I'll look into the first problem over the coming days. That's an interesting bug.

As for your second thought, it's a good idea. The problem is I didn't want to have keywords repeated, so the general append keys went through the unique cleanse processes as well. So if you had the word "product" as a keyword from your description, but also as a general append key, I didn't want to use that word twice, so it went into unique cleansing.

I'll consider some alternatives to this in the future though, as you have a valid point.

Best :)

Forrest

  • Hero Member
  • *****
  • Posts: 1972
  • Me and my baby
    • Web Developer
I think the solution to your second point... general append keys... is to create a second field all altogether called general_append_phrases... which would be added where you moved general_append_keys in your fix.

This way keywords are not repeated, but full phrases can be added. I'll add this to my hack soon.