Sunday, October 25, 2015

Turn Your Phone into Wireless CCTV Camera

CCTV camera mostly uses in many public places for stop crime or caught criminal or any thief. In some places it is used for security. Now many person uses CCTV at home for many other reasons.But installation of CCTV camera is costly, so normal people avoid of that. so don't worry about that if you have your old smartphone, then you can convert that into the camera and see live scream on another camera. Here below simple steps for that.
  • For that you need two smartphone one for CCTV camera and one for seeing live view of that camera. for CCTV you can use any old or unused smartphone.
  • Download "AtHome Video Streamer- Monitor" apps from Google play store and install on smartphone which you want to make as camera.
  • Now download another apps "AtHome Camera - Home Security" from google play and install on that phone you want to see live video. 
  • Now run "AtHome Video Streamer" on camera phone.
  • On this application there is option for generate QR code.click on that and generate QR code.
  • Now run "AtHome Camera" on other phone which you want to see live video.
  • On this application there is option for read QR code click on it and read QR code that generate from camera phone.
  • Now both smartphone links each other.
Now, Your camera is running for CCTV use there are many options for use according to your requirement.

Set Product Quantity Dropdown Instead of Textbox in Magento


Maganto is an open source eCommerce platform for creates shopping based website. Magento also provides community and enterprise edition.community edition is free for download and easy to use for storing many products and categories.
If you use Magento very well than must know that Magento provides a product quantity selection textbox for selecting product quantity. when you add that products in the shopping cart then you can see in the chart, there is also a textbox for change product quantity. So, according to website design sometimes it's important to change that text box and replace product quantity drop-down. Then it's easy to change the textbox to selection box with some changes in below files.

1. app/design/frontend/{THEME}/default/template/catalog/product/view/addtocart.phtml
See input box for quantity and replace that to selection dropdown for that find

<input type="text" pattern="\d*" name="qty" id="qty" maxlength="12" value="<?php echo max($this->getProductDefaultQty() * 1, 1) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" />
Replace with

<select name="qty" id="qty" class="input-text qty">
<?php
        //for get current product stock.
 $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);
 for($i = 1;$i<=$stock->getQty();$i++)
 {
 if($this->getProductDefaultQty() == $i){$sel = 'selected="selected"';}else{$sel = '';}
 echo '<option '.$sel.' value="'.$i.'">'.$i.'</option>';
 }
?>
</select>

Here change input box according to product type here below code only for simple product type change associate product type files according to product type.
for getting current product stock use below code as total quantity.

$qunt = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product->getProduct())->getQty();

This is changes for add dropdown on product details page for changes in shopping cart page change in below file.

2.  app/design/frontend/{THEME}/default/template/checkout/cart/item/default.phtml
See input box for quantity in table data item.find below code

<input type="text" pattern="\d*" name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4"
 data-cart-item-id="<?php echo $this->jsQuoteEscape($_item->getSku()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" maxlength="12" />
Replace with

<select name="cart[<?php echo $_item->getId() ?>][qty]" id="qty" class="input-text qty">
<?php
 //for get current product stock.
 $productsstk = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($this->getProduct())->getQty();
 for($i = 1;$i<=$productsstk;$i++)
 {
  if($this->getQty() == $i){$sel = 'selected="selected"';}else{$sel = '';}
  echo '<option '.$sel.' value="'.$i.'">'.$i.'</option>';
 }
?>
</select>
 
According to below files changes product quantity textbox replaced with dropdown you can apply the same change for any other files like wishlist,my cart column for setting product quantity dropdown instead of the textbox.