First, great module, I've got it running on one site and am getting ready to roll it out on another.

Is there any way to purchase "promotion to front page" or some similar feature?

I think this can also be done by allowing to purchase a feature, but I'm not positive and have been playing with it for a while now with no solid results.

Comments

larowlan’s picture

Status: Active » Closed (fixed)

Hi
This can be done if you know some Drupal coding with a custom module.
Look at hook_commerce_node_checkout_line_item_alter in the api docs. You've got access to the product and the node at the time of add-to-cart. You can test if that product is the 'buy promoted' one and update the node there if you like.
Lee

codenamerhubarb’s picture

A bad hack way to achieve this:

In commerce_node_checkout.rules.inc

after these lines:

$line_items[] = $line_item_wrapper;
$node = $line_item_wrapper->commerce_node_checkout_node->value();
$node->status = 1;

I added:

if($product->product_id == 13 || $product->product_id == 16){ 
$node->promote = 1;
}else{
$node->promote = 0;
}

...where 13 and 16 are the IDs of my "promote to front page" pay-to-publish products.