You can find the Ubercart invoice email template files @ sites/all/modules/ubercart/uc_order/templates. You could copy and edit the uc-order–customer.tpl.php to fit your needs but you could not select it @ E-mail customer checkout notification > Email an order invoice in Rules. This is because you have to implement the hook_uc_invoice_templates() before the new template is selectable.
Continue reading
Tag Archives: Ubercart
PHP – Get the next month by strtotime
I am working on a Hotel Booking website. The booking feature is provided by Hotel Booking System for Ubercart. But this module is not actively maintained so there are some bugs which i have to fix it for myself.
One of the bug is about strtotime(‘+1 month’). Intuitively, you may think you could get a date of next month. But here comes the problem. Assume you are now on 31st Jan. Since February only has 28 days (sometimes 29), strtotime(‘+1 month’) will return 3rd Mar.
Continue reading
Ubercart – Enforce unique SKUs in Attributes Adjustment
After you have enable the Product attribute module, you could adjust the SKU for products having different attributes. But there is no validation to check the SKU uniqueness. I try to enforce the checking by creating a custom module.
Continue reading
Drupal – Create PDF file with dompdf
dompdf is a HTML to PDF converter in PHP. In the GShop project, I need it for sending email with PDF attachment by the Ubercart Conditional actions in Drupal. The following example is done in Drupal 6 with Ubercart.
1. Download and extract the dompdf library to <drupal>/sites/all/libraries.
Continue reading
Ubercart – Get the product picture
You can get the product picture by the product node id using the following function
print uc_product_get_picture(<product node id>, 'cart');
you can use any other ImageCache settings by replacing the ‘cart’ parameter.
Done =)
Ubercart – Theme cart view in cart page
We can theme the cart page by the theme_uc_cart_view_form() function. Implement it in your theme template.php. Continue reading
Drupal – Enable Quantity Field for Ubercart Add to cart form
In the Ubercart product page, the product quantity option in the add to cart form is hidden by default. If you want to allow user modifying the product quantity in the order, create a custom module and implement the following hook. Continue reading
Drupal – “Paypal does not allow your country of residence to ship to the country you wish to” in Ubercart Paypal Payment
If you get the following error whenever u try to complete the payment of PayPal Website Payment Standard.
- Paypal does not allow your country of residence to ship to the country you wish to
Drupal – Delete all orders in Ubercart
I have created so many testing orders in the Ubercart during the development. So before i migrate the site to production, i have to clear all the testing orders. This could be done by deleting the order one by one through the View orders page.
But i got more than 100 testing orders and obviously the above method is not clever enough. Continue reading
Drupal – Add Extra Countries for Ubercart
By default, the Ubercart module provided a list of countries where you can add or remove them in Adminster -> Store administration -> Configuration -> Country settings.
If you cannot find the countries u need, there is an additional list of countries in the Ubercart website. Add them to your Drupal site as follow. Continue reading