Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

product_id not being assigned


Dnj1964

Recommended Posts

Posted

BS4   -    7.125

Attempting to add a new product to shop.

Admin shows that it saved the Manufacturer, Tax Class, Set Price, Products Model, and Images

Database Table Product_Description shows that it also saved the Products Description but when edit product description is blank.

Database Table Product_Description also shows product_id as 0

 

 

Posted
6 minutes ago, JcMagpie said:

Is the product description containing any html? as this can at times cause problem's in the db.

No sir.

currently it is just a single string of text until I figure out what happened.

all the other products contain html without any problems and they aren't affected, just the ability to add products with an id and have them show on the catalog side

Posted

Debugger shows

ReferenceError: $ is not defined[Learn More] products_new.php:584:5

<script>
    $('ul.nav li.dropdown').hover(function() {
  $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
}, function() {
  $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
});
</script>

 

Posted

Product doesn't show in 'New Products' but does show when selecting the category it was placed in but does show an id of 0

product_info.php?cPath=34_38&products_id=0

Posted

hmmm... don't think the 2 are related. It could just be a bad save of the product! have to attempted to deleat and add new product again?

 

Posted

Added the actual description back with the html and it saves and shows in the selected category no problem but with an id of 0

Posted

Yeah had a quick look and somthing definetly worng as the link you gave shows the product in a subcat that is not avaibable

 

Posted
30 minutes ago, Dnj1964 said:

ReferenceError: $ is not defined[Learn More] products_new.php:584:5

Add jQuery library before your script which uses $ or jQuery so that $ can be identified in script

 

Posted

Added

script type="text/javascript" src="/ext/responsivemenu/js/responsivemultimenu-en.js"></script>
 

into

/public_html/includes/modules/navbar_modules/templates/tpl_nb_horizontal_multi_menu.php

when I can get on my site I will try and add some products

Tracing route to 199.250.218.29 over a maximum of 30 hops

  1    <1 ms    <1 ms    <1 ms  192.168.1.1
  2     7 ms     8 ms     8 ms  10.90.128.1
  3    13 ms    12 ms    12 ms  10.0.68.57
  4    16 ms    17 ms    16 ms  10.0.18.74
  5    17 ms    14 ms    14 ms  10.0.18.33
  6    16 ms    17 ms    16 ms  4.59.214.145
  7     *        *        *     Request timed out.
  8    28 ms    31 ms    28 ms  4.79.22.110
  9     *        *        *     Request timed out.
 10     *        *        *     Request timed out.
 11    27 ms    27 ms    28 ms  199.250.218.29

 

Posted

Ok so adding the jQuery... well at least what I added didn't do anything.

 

Added product to different category with same results.

 

No show in What's New

 

Selecting product Category or Manufacturer and product is there.

 

 

Posted

:( let's try one at a time.

for

image.png.8c584f366432e03d1f0e10aae1cdbdaf.png

 

Edit to this, adding the ($) should fix that.

image.png.28fe05b5520535cb48ef0bfdb2f77aaa.png

Or you can remove or comment out the script

<!--<script type="text/javascript" src="ext/responsivemenu/js/responsivemultimenu-en.js"></script>-->

and the js

$('ul.nav li.dropdown').hover(function() {
$(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
}, function() {
$(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
});
</script>-->

and replace it with bootstrap 4 hover by using this,

<style>
/*bootstrap 4 css hover*/
.dropdown:hover>.dropdown-menu {
  display: block;
}   

</style>

 

Posted
1 hour ago, Dnj1964 said:

Added product to different category with same results. 

Did it still have 0 as product id?

 

Posted

I made the changes, previously had the script commented out

29 minutes ago, JcMagpie said:

:( let's try one at a time.

for

image.png.8c584f366432e03d1f0e10aae1cdbdaf.png

 

Edit to this, adding the ($) should fix that.

image.png.28fe05b5520535cb48ef0bfdb2f77aaa.png

Or you can remove or comment out the script

<!--<script type="text/javascript" src="ext/responsivemenu/js/responsivemultimenu-en.js"></script>-->

and the js

$('ul.nav li.dropdown').hover(function() {
$(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
}, function() {
$(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
});
</script>-->

and replace it with bootstrap 4 hover by using this,

<style>
/*bootstrap 4 css hover*/
.dropdown:hover>.dropdown-menu {
  display: block;
}   

</style> 

 

And yes adding a new product to any category or sub-category the product_id is 0

Posted

I replicated your $ error on the test site and it's a js order error adding the jquerry at the start fixed the problem on the test site.

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script type="text/javascript" src="ext/responsivemenu/js/responsivemultimenu-en.js"></script>
<link rel="stylesheet" href="ext/responsivemenu/css/responsivemultimenu.css" type="text/css"/>

 

If the script was already commented out then I'm confused as to why it's beeing called still :( .

Replacing all the js with the bootstrap hover should also work.

 

Posted
13 minutes ago, Dnj1964 said:

And yes adding a new product to any category or sub-category the product_id is 0

Bummer then I'm stumped as to why zero is beeing added to the new product! have you made any changes to public_html/admin/categories.php?

 

Posted

I don't have this in my file

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>

 

Posted

You refer several times to using "product_id". There is no database field by that name... it's "products_id". Make sure you didn't make that silly mistake!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...