For example, you want to set 40% alpha transparence to #000000
(black color), you need to add 66
like this #66000000
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global $woocommerce; | |
$woocommerce->cart->empty_cart(); //чистим | |
$custom_price = $price; //$price - переменная с ценой | |
$product_id = 11963; //id любого товара | |
$quantity = 1; //кол-во | |
$cart_item_data = array('custom_price' => $custom_price); | |
$woocommerce->cart->add_to_cart( $product_id, $quantity, $variation_id, $variation, $cart_item_data ); | |
$woocommerce->cart->calculate_totals(); | |
$woocommerce->cart->set_session(); | |
$woocommerce->cart->maybe_set_cart_cookies(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Get Max ID from table | |
SELECT MAX(id) FROM table; | |
-- Get Next ID from table | |
SELECT nextval('table_id_seq'); | |
-- Set Next ID Value to MAX ID | |
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, select | |
print "You have ten seconds to answer!" | |
i, o, e = select.select( [sys.stdin], [], [], 10 ) | |
if (i): | |
print "You said", sys.stdin.readline().strip() | |
else: | |
print "You said nothing!" |