Archive for 'Php File'

Sencha Datastore connection to PHP

Create a Table “Employee” with following fields in Mysql:

ID, FirstName, LastName, Salary

After that you need to create a php file “data-file.php” with script for listing table contents.

Then we need to create a Datastore to connect our php file data_file.php:

 

Incoming search terms:

  • Ext data HttpProxy fail to connect php file
  • sencha connect php file
  • sencha store php

Forcing a download using readfile() in php

Incoming search terms:

  • php readfile download jquery

You have setup a download-able product in PrestaShop and want to make it available to customer’s who have paid and are verified. By default, as soon as the order goes through the product download link becomes active – what if, you want to first verify the order and only then, make the download link active? PrestaShop already has the framework for this ready – you just need to fill in some code to get it working.

Open: order-detail.php
At the bottom of this script you will find this section:

Add this line just above it:

In the array you will put all the order statuses for which you want to prevent product download.

Open: themes/[your-theme-name]/order-detail.tpl
Find the section marked: <!– Classic products –>
Modify this section like this:

We have now removed the download links from the web but, what about the email that is sent?
I haven’t found a straight forward solution for it – what I have done is edited the email template and removed the download link altogether. Instead, I have added a message to the “order status change” email telling the customer to login into his account on the shop to download the product (no links are sent via any email)

Open: mails/[language]/download_product.html
And remove this tag {virtualProducts}
This will remove the link to download products from your email

You can now edit other email templates and add appropriate message informing the customer to login into his account on the shop to download the product.
You can check out the order statuses, whether an email will be sent when the order status is changed to it and the email template that will be sent via the admin area of your shop
Login into admin area > Orders tab > Statuses
Accordingly you can edit the email template file: mails/[language]/[email template.html or .txt]

I am sure there is a much more efficient method of doing it but, after a lot of searching this is what worked for me!

Parsing site URL using PHP