Posts

Showing posts from April, 2017

Adding wordpress custom admin notices

function shapeSpace_custom_admin_notice() { ?> <div class="notice notice-success is-dismissible"> <p><?php _e('Congratulations, you did it!', 'shapeSpace'); ?></p> </div> <?php } add_action('admin_notices', 'shapeSpace_custom_admin_notice');

add custom field to custom post type

function products_custom_init () { $labels = array ( 'name' => _x ( 'Products' , 'post type general name' ), 'singular_name' => _x ( 'Product' , 'post type singular name' ), 'add_new' => _x ( 'Add New' , 'products' ), 'add_new_item' => __ ( 'Add New Product' ), 'edit_item' => __ ( 'Edit Product' ), 'new_item' => __ ( 'New Product' ), 'view_item' => __ ( 'View Product' ), 'search_items' => __ ( 'Search Products' ), 'not_found' => __ ( 'Nothing found' ), 'not_found_in_trash' => __ ( 'Nothing found in Trash' ), 'parent_item_colon' => '' ); $args = array ( 'labels' => $labels , 'pub

php db functions

<?php class MarketplaceWebService_DB { function __construct($dbHost,$dbUsername,$dbPassword,$dbName){ // Connect database $conn = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName); if($conn->connect_error){ die("Failed to connect with MySQL: " . $conn->connect_error); }else{ $this->db = $conn; } } function getRecord($table,$where=array()){ $sql = "SELECT * FROM $table Where 1=1"; if(!empty($where)){ foreach($where as $key=>$val){ $sql .=' AND '.$key." = '".$val."'"; } } $query = $this->db->query($sql); $result = $query->fetch_all(); if($result){ return $result; }else{ return false; } } function getSingleRecord($table,$where=array()){ $sql = "SELECT * FROM $table Where 1=1"; if(!empty($where)){ foreach($where as $key=>$val){ $sql .=' AND '.$key." = '".$val."&

amazon item lookup

SimpleXMLElement Object ( [Request] => SimpleXMLElement Object ( [IsValid] => True [ItemLookupRequest] => SimpleXMLElement Object ( [IdType] => ASIN [ItemId] => B016MSMHAY [ResponseGroup] => Array ( [0] => Images [1] => ItemAttributes [2] => Offers ) [VariationPage] => All ) ) [Item] => SimpleXMLElement Object ( [ASIN] => B016MSMHAY [DetailPageURL] => https://www.amazon.com/Discovery-Kids-Canvas-Tee-Pee-Chevron/dp/B016MSMHAY?SubscriptionId=AKIAJH45BO6BHQ7YHORQ&tag=webdevehelp-21&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B016MSMHAY [ItemLinks] => SimpleXMLElement Object

amazon add product xml

<?xml version="1.0" encoding="UTF-8"?> <AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd"> <Header> <DocumentVersion>1.01</DocumentVersion> <MerchantIdentifier>{$merchant_id}</MerchantIdentifier> </Header> <MessageType>Product</MessageType> <PurgeAndReplace>false</PurgeAndReplace> <Message>     <MessageID>1</MessageID>     <OperationType>Update</OperationType>     <Product> <SKU>WM-35-00-03-29-17</SKU> <StandardProductID> <Type>ASIN</Type> <Value>B01HN75TCQ</Value> </StandardProductID>         <Condition> <ConditionType>New</ConditionType> </Condition>                 <DescriptionData>             <Title>Rainbow Majesty Party Pack for 16 Guests</T