Rename a file if same already exists


While uploading a file you may want to check if a file already exists in target directory then create a new file instead of replacing and rename new file with an incremental no. Example some_dir/some_file.png already exists, and you try to upload a file with name some_file.png again, so it should be uploaded as some_dir/some_file1.png … Continue reading Rename a file if same already exists

Advertisements

Manually submitting contact form 7 (ajax) and adding extra fields


Some time you need to perform some tasks before the contact form 7 is submitted but there is no easy way to do that to stop submitting the contact form for some time. For example, you want to wait for an ajax request to respond before submitting contact form 7. Here is the workaround. 1. … Continue reading Manually submitting contact form 7 (ajax) and adding extra fields

Integrating stripe using stripe.js and stripe-php library


Stripe is getting popular as a payment processor because of its simplicity and PCI compliance. To meet with PCI standards your website shouldn't send or store any credit card information to any where other than stripe, so to send credit card information directly to stripe we use stripejs. How it works Stripe.js collects credit card … Continue reading Integrating stripe using stripe.js and stripe-php library

Magento Unsupported operand types in…


Fatal error: Unsupported operand types in /app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php on line 873 If you are getting above error while exporting products in Magento 1.7.X The fix is simple. Open this file /app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php and go to line number 873. It should be working now.

Sending emails based on templates and placeholders with attachments using php and smtp


Being a web developer I often need to send emails based on user requirements, some time these are simple emails but some times users want to take control of email contents and attachments. To make it easier for me and other developers I have created a mail library which can be easily switched to php … Continue reading Sending emails based on templates and placeholders with attachments using php and smtp