[Done v157a] Product Master Category Bug
Zencart shop owner for years now,
I also contribute to buy the guys some darn big coffee's to keep them and us all going.
So i have a large site with over 70K items,
just noticed a few days ago that the category links now need extra work to make correct.
I have just gone back and adjusted nearly 1,600 items because of this.
What happens is that i create a duplicate item as a template, then i edit it to make a totally new item.
All items are different, but the same template from a live item.
So, the error i have is,
say I copy item A, to create item B a new listing,
I move item B from the category A to the new category, BUT it does not adopt the new category master,
I have to make sure I do a drop down if it is listed in two categories, or re edit if it is in just one catergory.
(I don't know if any one can folllow this).
So before when I moved an item to a new category, it adopted that category, now it just goes to error.
hope this bug is fixed on the next update chaps.
Re: Product Master Category BUG
Critical piece of information missing:
What Zen Cart version are you using?
And what plugins installed?
There was a bug with duplicating products, in the first release of v157 ... but you didn't say which Zen Cart version, so it's impossible to know whether your symptoms are fixable with that.
Re: Product Master Category BUG
Hi,
oops, yes critical indeed, silly me, i just thought that every one was using the latest version.
(You are presently using: v1.5.7)
PHP Version 7.3.23
plugin's are,
supertracker
ultimate url's
TM mega menu
Paypal mod.
i will give the link you sent a go, to see if this fixes it.
oh, and just a suggestion,
1,
on a new duplicate items listings the,
Copy Metatags to Duplicate?
Copy Linked Categories to Duplicate?
Could these radio buttons be set as default (OFF to NO )instead of ON,
would save me so much time.
2,
New image/s upload for an item,
Is there any chance we could selct several items at once to upload and press one button,
and the last/first image would be the main directory listing, this would also save loads of time.
thanks in advance, keep up the great work, i really appreciate you.
Re: Product Master Category BUG
hi again,
yes it worked.
I added the line to the
at 100 $sql_data_array['master_categories_id'] = $categories_id;
to
admin/includes/modules/copy_product_confirm.php
admin/includes/modules/product_music/copy_product_confirm.php
and now when I move an item to the new category, it now accepts the new category as master default.
thanks for all your help again.
Re: Product Master Category bug
Quote:
Originally Posted by
Footie1
oh, and just a suggestion,
1,
on a new duplicate items listings the,
Copy Metatags to Duplicate?
Copy Linked Categories to Duplicate?
Could these radio buttons be set as default (OFF to NO )instead of ON,
would save me so much time.
2,
New image/s upload for an item,
Is there any chance we could selct several items at once to upload and press one button,
and the last/first image would be the main directory listing, this would also save loads of time.
To possibly address item 1 above, the code responsible seems to be in: admin/includes/modules/copy_product.php or the product type override of that file. Look at/around lines 60-75: https://github.com/zencart/zencart/b...uct.php#L60-75
The zen_draw_radio_field ending with ", true" is defaulted to selected.
Re: Product Master Category bug
Hi Mc12345678,
thanks for your kind reply,
it is not a bug as per say at all, Zen cart is great software, i really like it,
yes it is complex and people can fine tune it to suit, is jst to save so much time on each item.
The radio button,
i located the file, but it seems to have eluded me as to which one the copy_metatags_yes', true OFF/False option is i should change, copy false/ture/no.
//only ask about metatags if defined
if ($metatags_defined) {
$contents[] = array(
'text' => '<h6>' . TEXT_COPY_METATAGS . '</h6>' .
'<div class="radio"><label>' . zen_draw_radio_field('copy_metatags', 'copy_metatags_yes', true) . TEXT_YES . '</label></div>' .
'<div class="radio"><label>' . zen_draw_radio_field('copy_metatags', 'copy_metatags_no') . TEXT_NO . '</label></div>'
thanks in adavance.
---
while (!$metatags_descriptions->EOF) {//one row per language
$db->Execute("INSERT INTO " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " (products_id, language_id, metatags_title, metatags_keywords, metatags_description)
VALUES (
'" . $dup_products_id . "',
'" . (int)$metatags_descriptions->fields['language_id'] . "',
'" . zen_db_input($metatags_descriptions->fields['metatags_title']) . "',
'" . zen_db_input($metatags_descriptions->fields['metatags_keywords']) . "',
'" . zen_db_input($metatags_descriptions->fields['metatags_description']) . "')");
$messageStack->add_session(sprintf(TEXT_COPY_AS_DUPLICATE_METATAGS, (int)$metatags_descriptions->fields['language_id'], $products_id, $dup_products_id), 'success');
Re: Product Master Category bug
As stated in my previous post, the function zen_draw_radio_field that ends with ", true" is defaulted to selected. So, this is the original where the copy_metatags_yes flag is auto-checked as "yes":
Code:
//only ask about metatags if defined
if ($metatags_defined) {
$contents[] = array(
'text' => '<h6>' . TEXT_COPY_METATAGS . '</h6>' .
'<div class="radio"><label>' . zen_draw_radio_field('copy_metatags', 'copy_metatags_yes', true) . TEXT_YES . '</label></div>' .
'<div class="radio"><label>' . zen_draw_radio_field('copy_metatags', 'copy_metatags_no') . TEXT_NO . '</label></div>'
Here it is with the no auto-checked:
Code:
//only ask about metatags if defined
if ($metatags_defined) {
$contents[] = array(
'text' => '<h6>' . TEXT_COPY_METATAGS . '</h6>' .
'<div class="radio"><label>' . zen_draw_radio_field('copy_metatags', 'copy_metatags_yes') . TEXT_YES . '</label></div>' .
'<div class="radio"><label>' . zen_draw_radio_field('copy_metatags', 'copy_metatags_no', true) . TEXT_NO . '</label></div>'
Re: Product Master Category bug
Hi again,
yes you are correct, this fixed the issue,
the radio buttons now default to off, brilliant.
I just did not know what to input ie false/yes/no.
thanks for your help.
I have added your above website link to my favs, when i need big help in the future, of which i will pay for of course.
kind regards to everyone who helped, and hopefully this helps someone else.
Thread can now be closed.