7

Drupal 7 doesn't use %placeholder style query placeholders. Furthermore, there's an error passing a list of strings to db_query instead of an array. Your query would be db_query('UPDATE {users} SET name = :name, mail = :mail WHERE uid = :uid', array(':name' => $name, ':mail' => $mail, ':uid' => $account->uid)); However, you should ...


6

The Basic cart module is the best solution for you... Basic cart is a very simple shopping cart / checkout process for Drupal, that just sends 2 emails after each order. Along with the shopping cart, this module also provides a block where you can view your cart's content. It's ideal for small websites with only a few products or other content ...


4

Go to admin/store/products/classes. From there you'll be able to assign a product class to an existing content type, after which you should see the Ubercart-specific settings on the content type edit form.


4

You need to define a new URL by using hook_menu. There, 'type' is set as MENU_LOCAL_TASK and URL is like 'node/%node/CUSTOM_CONFIG'. Code snippet from the hook_menu in node.module: $items['node/%node/edit'] = array( 'title' => 'Edit', 'page callback' => 'node_page_edit', 'page arguments' => array(1), 'access callback' => '...


4

Agree with the above and I would also add several suggestions: - use Taxonomy and Taxonomy Access Control modules to control access to content and who can update which service node - use Computed Field module that would take a value from related content to change a value (price) of the service/order depending on who did the work and what was the final ...


3

Here's a pretty simple function which will return all the order objects for a user (D7): function my_module_uc_orders_by_user($uid = NULL, $status = 'completed') { global $user; $uid = is_numeric($uid) ? $uid : $user->uid; if ($results = db_query("SELECT order_id FROM {uc_orders} WHERE uid = :uid AND order_status = :status", array(':uid' => $...


3

Find the following function in Drupal 7: /** * Custom function to return list of orders for certain user */ function foo_get_user_orders($user, $order_status = 'completed') { $query = db_select('uc_orders', 'uo'); $query->addField('uo', 'order_id'); $query->addField('uo', 'order_total'); $query->addField('uo', 'order_status'); // optional:...


3

You can use uc_payment_balance() function to know how much the customer still owes to you. uc_payment_balance($order) where $order - the order object


3

I've just created and submitted a module that might suit your needs. It is currently in sandbox. Let me know!


3

You can follow the below step: Go to Content management -> Content Filter content for content type "Product" Edit your product content Click on "stock" link in top of page Set the "Stock" and "Threshold" quantity and check "active" check-box save the form. Edit: Code snippets to display total and sold item from stock: $output = ''; $array_sku = ...


3

There is already module File downloads in the ubercart which allow user to sell file with the product. Install the module File downloads from the module list. Assigning directory to file donwload: Go to Administration -> Store -> Configuration -> Product In the File download settings section, set the path of the directory of the files and save ...


3

You can add custom fields to Ubercart orders the same way you add custom fields to content types. They can be added by going to Store -> Configuration -> Orders -> Manage Fields (admin/store/settings/orders/fields) These fields would then be available on the order admin pages. Hope that helps.


3

If you want to use that "Order subtotal" in a Rules "Condition", you could try to first add a Rules condition Entity has field (related to the field containing that "Order subtotal"). That's also what is mentioned in the Rules UI when you're adding a "data comparison" condition, somewhere it says: The data selector helps you drill down into the data ...


3

Below are 2 possible alternatives for setting up a simple shopping cart without using the Drupal Commerce or Ubercart modules (as in your "I don't want a huge functionality like Drupal commerce does. No products, products sku."). Option 1: A lightweight e-shop If you're only looking for a simple and lightweight e-commerce solution, have a looking ...


3

use Drupal\uc_order\Entity\Order; $order_load = Order::load($order_id); //Load Order $ownerinfo = $order_load->getOwner(); //Fetch Owner Info $ownerID = $order_load->getOwnerId(); //Fetch Owner ID $ownerEmail = $order_load->getEmail(); //Fetch owner email


2

This is how I solved it: function mymodule_uc_cart_alter(&$items) { $items[45]->price = 29393; } In this example I'm just hardcoding the change to demonstrate how to change the value. Obviously you would apply your own logic here based on whatever your requirements are.


2

You can easily remove review by installing uc_optional_checkout_review module and set the check box of "Skip checkout review" at admin/store/settings/checkout menu.


2

I think it is likely because your first result is a "0" and php will evaluate that as a False, which stops your while loop from running.


2

You may have to save the changes after you make them. After your decrement action, add another action to save the entity.


2

You can use the following code, where $nid is your product node id: Drupal 7 $nid = 4844; $form_state = array( 'values' => array( 'nid' => $nid, 'qty' => 1, ), ); $node = node_load($nid); drupal_form_submit("uc_product_add_to_cart_form", $form_state, $node); Drupal 6 $nid = 4844; $form_state = array( 'values'...


2

Activate the following Übercart modules: Shipping Shipping Quotes Flat rate Go to http://yoursite.com/?q=admin/store/settings/quotes and click on "Add flat rate quote". Fill out the from and submit it. The next form should be the conditions form. Create the necessary condition(s), for example, 0 < order:order-total AND order:order-total < 100 as a ...


2

One way to do this using the combination of ubercart custom payment module and ubercart discount coupon module, i.e creating a coupon of 100% discount and to bypass the payment process you will need the ubercart custom payment module (by default it provides the rule that can use it). Ubercart Discount Coupons: Coupons can apply either a fixed price discount ...


2

I had to do something similar to this in the past, where the website client wanted users to be able to mark items as favorites, and then email that list of favorites to the client for pricing and further information. Rather than building a whole e-commerce setup, I used webform and webform view. Here is the basic setup: Create 'food item' content type or ...


2

You need to alter the default Ubercart's theming of the shopping cart form and increase the weight of "Remove" column so it is pushed to the end. Add the following code to your theme's template.php file. /** * Themes the uc_cart_view_form(). */ function phptemplate_uc_cart_view_form($form) { // Increase the weight of Remove column, so it goes to the ...


2

If you want to alter the cart item, then you can use hook_uc_cart_alter of ubercart. This hook is not in documentation of ubercart 7 but its still working for Ubercart 7. This is called every time the cart is rebuild (e.g. when products are added), so it's a good place to alter the cart item. I have checked uc_coupon module and hook ...


2

Thanks to Clive for pointing me in the right direction. As requested here is a code snippet I used in my module. I was able to take the code found in uc_product_class_form_submit() and make minor changes to make it work for my situation. Essentially, in my module, I'm using hook_enable to call a helper function which checks for an existing product class. If ...


2

In your custom module use the hooks defined in the Ubercart terms and conditions module.


2

VBO comes, out of the box, with some predefined (hardcoded) operations that can be applied to each row selected in the view. The available operations are shown within "Selected bulk operations" when configuring the VBO field. Obviously, something like Edit taxonomy terms isn't one of them. However using Rules (Conditions and/or Actions) you can execute a ...


2

Taking Chris's answer an putting it in Answer format for readability. Figured it out, perhaps this will be of help for someone :) $product_nid = 2; $some_data = array('attributes' => array( '1' => '1', ), ); uc_cart_empty(uc_cart_get_id()); $data = serialize($some_data); uc_cart_add_item($...


2

Assuming author of product is also seller, You can do this with a rule using loop and author:mail. Try importing this rule and see how it works { "rules_e_mail_seller_checkout_notification" : { "LABEL" : "E-mail seller checkout notification", "PLUGIN" : "reaction rule", "REQUIRES" : [ "rules", "uc_cart" ], "ON" : [ "uc_checkout_complete" ], "DO" : [ { "...


Only top voted, non community-wiki answers of a minimum length are eligible