Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8883645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:51:55+00:00 2026-06-14T20:51:55+00:00

As topic says i have problem with adding product (by using product class). Everything

  • 0

As topic says i have problem with adding product (by using product class). Everything works fine but even if i specify $product->id = 1234; it doest save it with this id, it just autoincrements products in database. But i really need to insert my own product_id into database (since i import products from ground strone database and they’ll need to be updated often)

Here is my code:

$langId = (int) (Configuration::get('PS_LANG_DEFAULT'));
$p = new Product($prod['towar_id']);
$p->id = $prod['towar_id'];
$p->name = array($langId => $prod['nazwa']);
$p->ean13 = $prod['kod'];
$p->id_category_default = 6;
$p->category = array(6);
$p->link_rewrite = array($langId => Tools::link_rewrite($prod['nazwa']));
$p->weight = $prod['ile_kg_litrow'];
$p->quantity = $prod['magazyny']['magazyn']['stan_magazynu'];
$p->price = $prod['cena_detal'];
$p->add();

So is there any way to insert my own product id ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:51:56+00:00Added an answer on June 14, 2026 at 8:51 pm

    I managed to fix it by adding $_GET[‘forceIDs’] = 1
    or simply do ?forceIDs=1 at the end of url.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem as the topic name says: Lets say i have gallery
As the topic says I'm very new to c++, but I have some experience
I guess the topic says it. I have tried googling this, but havent gotten
The topic says it all. I have a dictionary of dictionaries(yes, it's a dictionaryception!)
The topic says it all. Using Compact Framework C# I'm tiling (order/sequence is important)
There have been a few threads on this topic but none have been able
I have been using sonar on my local machine for a long time but
I have a camera app that works on most phone but I got an
I guess topic says it all! But, I really wan't a syntax similar to
As the topic says - What is the biggest problem that would occur if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.