News:

Looking for documentation? Take a look on our wiki

Main Menu

Trying to add product with python using requests library

Started by gigamarr, October 14, 2019, 19:22:17 PM

Previous topic - Next topic

gigamarr

Hello, my goal is to be able to send data from remote python server and add products to virtuemart that way (which of  course is located on another server).

My script does following: (using python requests library)
1. goes to domain.com/administrator/index.php
2. logs in successfully
3. goes to /index.php?option=com_virtuemart&view=product&task=edit&virtuemart_product_id=0 and sends POST data to this url

step 3 goes by without any errors but i don't see new products being added, for now i'm only sending "product_name", and predefined values of hidden inputs with names: task, option, boxchecked, controller, view and one more input which doesn't have a static name, I think it's csrf token, I'm sending that as well. Is what I'm trying to achieve possible with this approach? any guidance is appreciated

pinochico

- Use python script for creating XML file and this file import to Virtuemart
- Use eMagic for write to DB
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Studio 42

You have to write your own script to add the product to DB.
Because you need form token and valid user for VM, it's better to use com_ajax for eg and a plugin or use your own Joomla component to add the product to DB