php to export ExpressionEngine database query to .txt file - php

I am currently working on a project where I am looking at converting ExpressionEngine channel entries into individual .txt or .csv files. I can export all channel entries into one file, but I am struggling when it comes to separating each entry into individual files...
I am integrating the website with a clients stock inventory system for their retail stores. The software inputs .txt or .csv files into the system when an order is placed in store, this then updates their stock inventory.
The website is going to display their products with live stock inventory based on in store orders and online orders.
I am looking into pulling data from each order via an sql query and exporting this as a .txt file. Each order will create an individual text file and once an hour the .txt files will be exported to a folder within the server via a cron. This is the folder the clients stock inventory system uploads the .txt files from. so if an order is placed via the website, the file will be exported and uploaded to the stock system, reducing the stock inventory for that item buy the amount in the order.
Any suggestions or pointers would be appreciated.
If this is a complicated way of achieving this and anyone has a more simplified solution then please let me know.
Thanks in advance

What module are you using for your e-commerce setup? Chances are it has an extension hook you could use that fires after each order is completed. You could add your code in that hook to export the order as a text file directly into the aforementioned folder on the server.
CartThrob: cartthrob_on_authorize
Store: store-order-complete-end
Brilliant Retail: br_order_create_after

Related

Upload files to orders backend in woocomerce

I have been searching for a solution to allow me to upload files via the order page backend
we do artwork for most of our orders and would like to be able to manually add the file into the already processing orders backend, this is mainly for our purposes when printing jobsheets etc, but if the customer has an account be handy for them to access it to (but not to important)
i have searched for plugins but all seem to be for frontend rather than backend.
only way i think could be done is via custom field which i have tried but failed
im new to this site so i hope this question is allowed sorry if it is not
Tried implementing via custom field backend but did not work

Wordpress bulk products upload (woocommerce) - 650K

I'm using WordPress + Woocommerce for one project. The problem is that the CSV file from the client has over 650k records for products and I have to upload all these products to woocommerce store.
Wordpress using 2 tables (wp_posts, wp_postmeta) for products and 3 tables(wp_terms, wp_term_taxonomy, wp_term_relationships) for categories and tags. All products should be uploaded as just simple woocommerce products.
Not sure what could be the best option for such data migration.
I tried to use a WordPress import plugin for this (WP All Import) but it was taking too much time.
By using this script (largeCSV2mySQL) I was able to import 650k products info to the database table in less than 10s. Is there anyway to import all those 650k products to woocommerce store in such a fast way?
What could be the best experience to handle such huge data?
I highly recommend using the Woocommerce REST API to perform the population of the data. You'll definitely need to write code to process your file by utilizing the CRUD actions available to you. The REST API handles most of the heavy lifting, all you need to do is read the data from your file and fit it to the API.
If you do have a large number of products to import, and it's all in a single file, try composing your importer to only process a range of lines (can do with with command line parameters). That would allow you to run the import in multiple terminals and split the load, rather than having to write something that's multithreaded using pthreads.
I recommend creating a function that retrieves the data from the file and sends it to WordPress/Woocommerce with wp_insert_post and the post_type 'product'.

Joomla PHP code

I'm new in using Joomla and i need your help please.
I'm newly working in a company. The company bought a web shop from other company and the web shop is live now.
One button in one of the pages is responsible to place an order and the action for this button is to send an email with all the data about the orders to my company.
Now my task is to develop an API which does the following:
when clicking on that button the information should be handles in certain way and sent to other system which our company have and this system is used by my company to handle the different orders.
My problem is that i can't find the php page that contains the code which is creating these orders email in order to change it.
Is there is any tool or plugin which might help or do you have any idea how to handle this situation?
Hint: I'm not able to get any support from the company who programmed the web shop
It is very hard to tell you what to do when we don't even know which Joomla e-commerce extension you are using. Nevertheless, there are things that you can do to find out which file is doing the actual processing of the order.
However, before even doing that, you will need to define what "order processing" means. Is it when the order is saved to the database? Is it when the order is approved by the payment gateway?
In the first case, you will need to look up for code saving the data to the database (which is likely in the models folder of the extension - it might also be in the controllers), in the latter case, you will need to look up for the code processing the payment (which is likely in the controllers folder or the helpers folder).
Note that some "advanced" e-commerce extensions trigger events when an order is processed that you can use in a plugin in order to do what you want.

how to attach downloadable file in virtuemart 2 in joomla

I am using virtuemart extension version 2.0.22a in my joomla site.
I want to sell digital products using vm(virtuemart). So when payment done user will be able to download product zip file.
But it seems i can't find where & how do I attach product download files in vm 2. Earlier versions of vm had downloads tab in configuration.
It's look like i have to buy another paid plugin for this said here -
help forum topic
This should not be accepted, there should be way to attach downloadable files(zip,..) with the product at least.Even many free e-commerce sites, extensions have at least downloadable files. So why should not be here in vm.
Any one help me to attach downloadable zip file with the product in vm or if its that i need to add a paid plugin then tell me alternatives.
If you can customize the VM little bit an alternative option in my mind, I am not sure this is acceptable for you.
When someone place an order in your site an order confirmation should send as email that email should have a proper order_id and expiry token. Also a download count in your custom table.
And order confirmation page should says check your inbox.(or even you can set the link inside confirmation page).
Check the link and validate order id,expiry token and download count.
Also if the files are not large in size you can choose attach file option for email.
Hope its give some idea for your task.

How to properly configure magento to include a file upload link during an order notification? integrated with joomla magebridge component

Our website is a printing type service and it has the capacity to take the order of customers with the following procedures:
They select the type of product that they want to order
Select the paper size and the quantity of the item
The customer needs to upload a file in pdf format (This is the file to which they include the design that want for their order)
The system will send an email to both the customer and the owner (The email should include the direct link on which the uploaded file should be downloaded)
The emails are successfully sent with the details of what items they want to order. A link is included on the email but what it displays is this sample code:
Item Sku Qty Subtotal
Letterhead 100gsm Matte A5 500
File Upload - File will upload after you click Buy Now
The "" should be the download link of the pdf file that the customer have uploaded on the server. I need help on this were currently using Magento 1.5.1.0 and I have been wondering were the bug is on how to include the proper link to the pdf file uploaded by the customer.
And also we have a joomla version of the site which is using a magebridge component the main purpose of the component is to connect joomla with a magento site to enable joomla to integrate some of the important functionalities of magento. So basically users would visit the joomla site and do the transactions they need to do.
Thanks
To display a link to the file that was uploaded in customer's email confirmation in magento v1.7.
Copy this template file to your local template folder /app/design/frontend/base/default/template/email/order/items/order/default.phtml
Then change this line (#37)
<?php echo (isset($option['print_value'] ) ? $option['print_value'] : nl2br($this->escapeHtml($option['value']))) ?>
to
<?php echo (isset($option['print_value'] ) && $option['option_type'] != 'file' ? $option['print_value'] : $option['value']) ?>
This may or may not work in version 1.5.1

Categories