insert query for adding product in prestashop - php

I have an existing desktop application for managing my shop. Now Im making an online store, for that I have used prestashop. I have to add all the products from my old application to online shop. Also in future I will add new products through desktop application only. But when I add new product it should be reflect in the online shop.
Im planning to update the database from desktop application. For that I need to view the insert query for adding a product in prestashop. But I didnt find anything.Please guide me.
Thanks in advance,
iijb

For a simple product creation, you will have to populate these tables :
ps_product
ps_product_shop (if prestashop version >= 1.5)
If you have combinations (E.g. Blue XL Tshirt, Black S Tshirt, ...) you need to populate these tables too (but this won't be easy) :
ps_product_attribute
ps_product_attribute_combination
ps_product_attribute_shop
You have to look the database schema with phpmyadmin to see field names.
Anyway I suggest you to study how works modules such as oscommerce to prestashop, or magento to prestashop.
Good luck

I run Prestashop 1.6, I believe that you will also have to enter the description in ps_product_lang. You may also have to make an entry of physical quantity available in ps_stock_available. For sure if you use advanced stock management.
Hope it helps!

Related

Prestashop sharing product stock between two seperate prestashop websites

I have a two seperate websites(f.e. abc.com and 123.com) Shops have the same products, but different prices. I want that these two stores would share product stock and nothing more. So I guess it's just one column from database. Is there a good way to synchronize product stock between two seperate prestashop websites?
In order to achieve your goal. You should use the multistore functionality in Prestashop (sharing products and stock), see doc.prestashop.com/display/PS16/Managing+Multiple+Shops
As I assume you aren't using it for a specific reason, you would need to go and create your own module. Your module should register to the actionUpdateQuantity hook, meaning everytime your stock changes, it should do something, namely send a message to the other shop.
Normally, you would use the Prestashop webservice for this kind of behaviour, but as the webservice has some problems with stock management (see http://forge.prestashop.com/browse/PSCSX-3170, mainly having to do with the advanced stock management). I don't know if you use the ASM functionality, but I've created an example module for syncing your stocks. It can be adapted to be compatible with ASM functionality.
In the module configuration, you'll find the Sync URL of the current shop, you can use that URL in the other shop. So you'll install the module on both shops and cross reference them. I've created a separate sync.php file which will be called to sync the stock. As said, normally you should use the webservice functionality for this (and if you dont use ASM, you can adapt it to use the webservice, if you do use ASM, you must adapt it to allow for stock movements and valuation).
For the code, see the repository at https://github.com/mwienk/prestashop-syncstock

How do I get / set product price programmatically?

I'm using Woocommerce and trying to make a desktop application which manipulates products and prices (planning to use visual basic).
I've searched the internet a lot however couldn't find a good answer to where the product names and their prices are stored.
Can I manipulate data using php or mysql from desktop?
WooCommerce stores products in the 'posts' table of the schema. Instead of manually updating the DB, I would use the provided API.
From there, you can let WooCommerce handle all of the nitty gritty of updating products, managing the data structure, etc.
This also allows you to not have updates to WooCommerce break your application if they change their DB layout.
WooCommerce API v3

Magento tasks for learning

I am learning Magento. I have already installed and gone through admin side.
Have done for adding customers ,Products ,Pricing or other stuffs. Now I want to learn more things (currently don't want to go for code and database).
Can anyone post here sample tasks (specially for learning). Because as I said am new to magento and don't konow exactly what type of tasks we can do in Magento.
I want some good tricky and sample tasks to do in magento. So I can learn it more.
1.) Change the favicon logo.
2.) Change the magento home page logo.
3.) Change the Top links "name" Ex: My Cart as image.
4.) Adding new link in top links.
5.) Move the top menu navigation as left menu navigation.
6.) Creating banner slider in home page
7.) Listing the feature products in home page.
8.) Need to put newsletter subscription in footer area.
9.) Removing the magento ads in right column (i.e) The dog and poll removing.
10.) Adding the new column in sort by order in category page.
11.) In product detail page need to show product description and some other information as tab format.
12.) Magento registeration need to enable extra options like company name, phone number, address, user type.
13.) Each customer group need to show different type of price for products.
14.) While importing products we to import the tier price to each products.
15.) Creating new attributes to products. And need to import values to that new attribute.
16.) Adding custom new column while registering a customer. And it need to show in admin side as editable.
Basically you are in e-commerce domain and magneto is a e-commerce framework which provide a platform to build e-commerce application with some build in out of the box functionality so that the developer at the end of the day not have to start building things from scratch.
what type to tasks we can do in Magneto.
being a eCommerce platform it provides you out of the box functionality ranging from product management,category/catalog management,shipping,checkout process,user management,post order process etc and many other things.
E-commerce in itself start from application like B2C (Business to customer), B2B (business to business).
I want some good tricky and sample tasks to do in magento
i am not sure what exactly you mean by this statement what you want to learn how exactly flow going on or how you can customize the things.
my suggestion is to explore some e-commerce implementations like amazon,eBay etc see how things flow there and than come out what you want to have in all.
i have not worked with magento but being in e-commerce domain i know every platform provide some sample reference application so it should be the case with Magento so just run that application and see how flow is going on and play around with it.
one thing that seems good to start is checkout process as it is always an integral part of any B2C implementation.
Other aspect is Product content management.
How about learning to create tier prices for customer options? I am quite sure that you need this for the future someday.
Magento allows tier prices for products and prices for individual options. However, tier prices for individual options are not supported. Tier prices for individual options are needed e.g. when selling promotional items or textiles with custom imprints. To create individual tier prices just try one of these three options:
one of these three options:
Realizing the surcharges with Cart Price Rules
Simple Configurable Products / Better Configurable Products
Generating additional individual options with prices
In my opinion the last one is the best solution. An individual option only allows one surcharge, when more are needed (one for each tier price you want to have). So you create several options with different prices. By doing so the following module might help you. You can request it for free at: http://www.code4business.de/kontakt-impressum/.
This module requires entering of tier prices and individual options in the backend. Afterwards the prices of the individual options for each tier price are entered in the newly generated options. When you save it, the following table of individual options will be generated. In this table, the tier prices can be entered for the original individual options. After filling out all these fields, the result is expected to be in the checkout.
I hope this is the kind of learning-idea you imagined! If you have further questions just take a look at this link. It offers you detailed descriptions with pictures how to create tier prices:
http://www.code4business.de/tier-prices-for-magento-custom-options-en/

Interspire to Magento migration

I recently started with Magento and decided to migrate Interspire shopping cart I already made time ago to it. At first look Magento seems a very huge beast - lots of options, maybe lack of simplicity resulting in some performance loss. I've got user guide from which I am not getting much of benefit since there're just descriptions of very ordinary tasks that I could easily discover myself by poking around frontend/backend. So my first tasks are category and product export. Interspire seems to be exporting ONLY products in three available formats:
Default
MYOB
Peachtree accounting
I did some searching on Magento's product importing and found a blog post which says that I should create a few sample products with all the necessary attributes myself and then start the import. But what should I do with categories ? Is it possible to import them or instruct Magento to automatically create categories when importing product file if unknown category is encountered ?
Thanks
Thanks for the advertisements folks ! though I would prefer an advice how to do it myself. I found out that I can do it for free, since Interspire supports Interspire -> OsCommerce migration and there's free OsCommerce -> Magento migration module in Magento Connect, only thing I need to do is to setup temporary OsCommerce on public server.

Letting users create customized Bundles in Magento

We are building an e-commerce site where users can create their own bundles with products of their choice. Other users can then buy these bundles.
Please guide me as to how a bundle can be created based on the products selected by user and store this bundle. From whatever little I have read, I can create a module which will do this. Is this the right approach, or is their any other way to do it. I have gone through Alan's post to create modules, but still my magento knowledge is limited.
I am new to magento, and a newbie programmer (hence this is my first post on stackoverflow), any detailed description will greatly help me.
Thanks.
Isn't a shopping cart a user bundle by definition?
You can save the order information and create bundled items from that
Create an administration module that parses the information from orders and chooses automatically the most selected group of packages and creates automatically a product based on that.
If you want to involve the user that is more work for the CRM than for Magento, allowing the user to create bundle products and save them.
Update
From your comments I see 2 ways of solving this issue
with the help of the checkout and order object - when a selection is saved.
without any connection with the checkout process you'll build a frontend module that will save independently a bunch of products and will transform the selection into a backend bundle product that will be later available to all users. Steps to do towards this approach
build the interface to let the user select several products
make a save action that will grab the currently selected products from a cookie or somewhere and tranform that in the background in a product.
save the product and reindex the site to have the product available

Categories