Thursday, April 21, 2011

Document library functions




Document library functions in the opencart
setTitle($title):
The title of the page is set with the call of $this->document->setTitle($title); where $title is the parameter which take the string.
public function setTitle($title) {
$this->title = $title;
}
getTitle():
$this->document->setTitle() means the title is get and set to <title> of the document
public function getTitle() {
return $this->title;
}
setDescription($description):
$this->document->setDescription($description) which set the description of the page.
public function setDescription($description) {
$this->description = $description;
}
getDescription():
$this->document->getDescription() gives us the description of the document which is embedded in the <head> of the document
public function getDescription() {
return $this->description;
}
setKeywords($keywords):
$this->document->setKeywords($keywords) set the SEO keywords
public function setKeywords($keywords) {
$this->keywords = $keywords;
}
getKeywords():
$this->document->getKeywords() get the keywords which are set for the page.
public function getKeywords() {
return $this->keywords;
}
setBase($base):
$this->document->setBase($base) the base url for the document. If we need different base url then we have to set it.
public function setBase($base) {
$this->base = $base;
}
getBase():
Retrieve the set base url
public function getBase() {
return $this->base;
}
setCharset($charset):
public function setCharset($charset) {
$this->charset = $charset;
}

getCharset():

public function getCharset() {
return $this->charset;
}
setLanguage($language):
public function setLanguage($language) {
$this->language = $language;
}
getLanguage():
public function getLanguage() {
return $this->language;
}
setDirection($direction):
public function setDirection($direction) {
$this->direction = $direction;
}
getDirection():
public function getDirection() {
return $this->direction;
}
addLink($href, $rel):
public function addLink($href, $rel) {
$this->links[] = array(
'href' => $href,
'rel' => $rel
);
}

getLinks():
public function getLinks() {
return $this->links;
}
addStyle($href, $rel = 'stylesheet', $media = 'screen'):
public function addStyle($href, $rel = 'stylesheet', $media = 'screen') {
$this->styles[] = array(
'href' => $href,
'rel' => $rel,
'media' => $media
);
}

getStyles():
public function getStyles() {
return $this->styles;
}

addScript($script):
public function addScript($script) {
$this->scripts[] = $script;
}
getScripts():
public function getScripts() {
return $this->scripts;
}

addBreadcrumb($text, $href, $separator = ' > '):
public function addBreadcrumb($text, $href, $separator = ' > ') {
$this->breadcrumbs[] = array(
'text' => $text,
'href' => $href,
'separator' => $separator
);
}

getBreadcrumbs():
public function getBreadcrumbs() {
return $this->breadcrumbs;
}

Wednesday, April 20, 2011

Rupak Nepali CSV import Export for opencart




Click to Download Rupak Nepali CSV import Export for opencart

Unzip the files and

Copy and paste the files in their respective folders.

  ====================================================

  Paste the following

<li><a href="<?php echo  HTTPS_SERVER . 'index.php?route=tool/csvproduct&token=' . $this->session->data['token']; ?>">Product Category CSV</a></li>

in the admin\view\template\common\header.tpl

below these lines

   

  <li><a href="<?php echo $error_log; ?>"><?php echo $text_error_log; ?></a></li>

  <li><a href="<?php echo $backup; ?>"><?php echo $text_backup; ?></a></li>

  ======================================================


Now open in the browser login in the admin

Give permission to the user (You can set the permission by admin only) for tool/csvproduct

admin>> System>> Users>> User Groups>> Then select the user and click edit and check the tool/csvproduct  on both the access permission and the modify permission


======================================================

After that click on the System>> Product Category CSV

======================================================



Sliding Banner Management Code for the opencart.




Click to Download Rupak Slider Banner Management of Opencart

From the downloaded file extract the file with WinRAR archiver and you will be able to get the zip file extracted and then follow the following steps:

Copy and paste the files in their respective folders.

====================================================

Paste the following
<li><a href="<?php echo HTTPS_SERVER . 'index.php?route=catalog/banner&token=' . $this->session->data['token']; ?>">Banner Management</a></li>
in the admin\view\template\common\header.tpl
below these lines



<li id="catalog"><a class="top"><?php echo $text_catalog; ?></a>

<ul>

<li><a href="<?php echo $category; ?>"><?php echo $text_category; ?></a></li>

<li><a href="<?php echo $product; ?>"><?php echo $text_product; ?></a></li>

<li><a href="<?php echo $manufacturer; ?>"><?php echo $text_manufacturer; ?></a></li>

<li><a href="<?php echo $download; ?>"><?php echo $text_download; ?></a></li>

<li><a href="<?php echo $review; ?>"><?php echo $text_review; ?></a></li>

<li><a href="<?php echo $information; ?>"><?php echo $text_information; ?></a></li>
======================================================
Run the Sql in the "Sql for the database.txt" onto your database.
======================================================
Now open in the browser login in the admin
Give permission to the user (You can set the permission by admin only) for catalog/banner
admin>> System>> Users>> User Groups>> Then select the user and click edit and check the caralog/banner on both the access permission and the modify


permission


======================================================
After that click on the Catalog >> Banner Managment
======================================================
Copy the below code on which you want to show the banner changing

======================================================


<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/slider.css">

<script type="text/javascript" src="catalog/view/theme/default/js/easySlider1.7.js"></script>

<script type="text/javascript">

$(document).ready(function(){

$("#slider").easySlider({

auto: true,

continuous: true,

numeric: true

});

});

</script>




<script type="text/javascript">

function slideSwitch() {

var $active = $('#slideshow IMG.active');



if ( $active.length == 0 ) $active = $('#slideshow IMG:last');



// use this to pull the images in the order they appear in the markup

var $next = $active.next().length ? $active.next()

: $('#slideshow IMG:first');

$active.addClass('last-active');



$next.css({opacity: 0.0})

.addClass('active')

.animate({opacity: 1.0}, 1000, function() {

$active.removeClass('active last-active');

});

}



$(function() {

setInterval( "slideSwitch()", 5000 );

});



</script>
<div id="slider">

<ul>

<?php

$result = mysql_query("SELECT * FROM banner b inner join banner_description bd on bd.banner_id=b.banner_id ");

$i=0;

while($row = mysql_fetch_array($result))

{



?>

<li>

<a href="<?php echo $row['link']; ?>">

<img src="image/<?php echo $row['image']; ?>" alt="" title="<?php echo $row['description']; ?>"/>

</a>

</li>

<?php $i++; }

?>

</ul>

</div>
======================================================

Workout with the css so that you can make as per your choice



Tuesday, April 19, 2011

Shipping Rules/Protocols that can be used




Shipping Rules/Protocols
Customer will have two options for orders under $750 and/or outside LA, OC; three options for orders over $750 who are within LA/OC area, two options for orders over $750 whose ship to address is outside of LA/OC area. We won’t be using UPS’s API since products exceed their dimension limitations.  We’ll be creating an account with ABF - I’m in the process of establishing an account.

RULES:
Order < $750
·         Will Call
·         ABF Carrier  

Order > $750
·         Will Call
·         ABF Carrier
·         Free Local Delivery inside OC/LA

Order > $750 Outside OC/LA
·         Will Call
·         ABF Carrier
·         //Order receives automatic $50 credit in lieu of Free Local Delivery// needs approval..so wait on this, just wanted to give you a headsup

ABF API
·         Utilize combination of ABF Transparent Direct Links: http://www.abfs.com/ecommerce/tlinks/ for backend and frontend integration
o   Bill of Lading – Backend only http://www.abfs.com/ecommerce/tlinks/tl_bol.asp?NCHK=SPLM
o   Pick up request – Backend only http://www.abfs.com/ecommerce/tlinks/tl_pickup.asp?NCHK=SPLM
o   Document Retrieval – Frontend Customer Account Page http://www.abfs.com/ecommerce/tlinks/tl_docret.asp?NCHK=SPLM
§  Allows customers to retrieve documents associated with shipment by purchase order# or customer reference#
o   Rate Quotation – Backend only? Should match rate provided on calculator, if calculator integrates on the frontend I don’t know why we would want to provide another quote option. Seems like potential problems would be too high to justify giving the customer this. http://www.abfs.com/ecommerce/tlinks/tl_aquote.asp?NCHK=SPLM
o   Tracking – Backend & Frontend Customer Account Page http://www.abfs.com/ecommerce/tlinks/tl_tracing.asp?NCHK=SPLM
o   Transit Time Request - Backend & Frontend Customer Account Page http://www.abfs.com/ecommerce/tlinks/tl_transit.asp?NCHK=SPLM

·         Front end will use ABF shipping charge calculator on product page, order page: http://www.abfs.com/ecommerce/scc/
Requirement of the clients in the opencart and how I am going to tackle it and develop logic is glittering mind. Hope I will get the solution by brainstorming and searching if anyone who have already work in the abfs I will be very thankful

Collection of Opencart Module




Free opencart Module

download extension

dead cow extension for SEO
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=39962

calculator extension module for opencart

http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=38546


Sliding of brands module

http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=38303

latest product slideshow

http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=38302

You tube Video integration module
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=34422


Rss Feed
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=32809

Module to show module in the tab form

http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=31387

For next and previous sowing of the opencart
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=9767

JQZoom module

http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=29442


Live Help Module
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=29123

Skype module showing is i am online or offline
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=19095

Social networking module for opencart
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=15556

Visitor count module for opencart
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=12487

Lovely and nice manufacturer images showing
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=12237

Stock Reporting module
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=10947

Opencart Export/Import Tools
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=49746


Pdf file uploader
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=47910

Product Attribute Image help in opencart
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=35317

Batch Upload of Images
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=30600

News letter suscribe module for the opencart
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=26033

Options image module for opencart
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=17968

Proof of invoice and packingslip
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=15095


Search Key reporting
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=9595

Category with product count
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=8976

Floating save and continue
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=8976

Iweb extension of opencart in the mobile
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=5221

shipping by weight in opencart module
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=3794


Skype for opencart
http://www.opencart.com/index.php?route=extension/extension/download&extension_download_id=3794

About the configuration class in the opencart




config:
config consists of 5 functions and they are as follows:
get($key):
$this->config->get('welcome_text_position'): is the example that check whether the data is set or not if it is not set then it will return null.
public function get($key) {
return (isset($this->data[$key]) ? $this->data[$key] : NULL);
}
set($key, $value):
This is used to set the value and is done by $this->config->set($key, $value)
public function set($key, $value) {
$this->data[$key] = $value;
}
has($key):
Check whether there is key available or not.
public function has($key) {
return isset($this->data[$key]);
}
load($filename):
This is the function which loads the file that the parameter is passed. If it does not find the file then it will return the error message saying ‘Error: Could not load config filename’
public function load($filename) {
$file = DIR_CONFIG . $filename . '.php';
if (file_exists($file)) {
$cfg = array();
require($file);
$this->data = array_merge($this->data, $cfg);
} else {
exit('Error: Could not load config ' . $filename . '!');
}
}

how to get the configuration class, uses of configuration function and its uses, function on the configuration

About the currency function on the opencart





currency:
set($currency):
Set the currency to be used in overall site.
public function set($currency) {
$this->code = $currency;
if ((!isset($this->session->data['currency'])) || ($this->session->data['currency'] != $currency)) {
$this->session->data['currency'] = $currency;
}
if ((!isset($this->request->cookie['currency'])) || ($this->request->cookie['currency'] != $currency)) {
setcookie('currency', $currency, time() + 60 * 60 * 24 * 30, '/', $this->request->server['HTTP_HOST']);
}
}
format($number, $currency = '', $value = '', $format = TRUE):

public function format($number, $currency = '', $value = '', $format = TRUE) {
if ($currency && $this->has($currency)) {
$symbol_left = $this->currencies[$currency]['symbol_left'];
$symbol_right = $this->currencies[$currency]['symbol_right'];
$decimal_place = $this->currencies[$currency]['decimal_place'];
} else {
$symbol_left = $this->currencies[$this->code]['symbol_left'];
$symbol_right = $this->currencies[$this->code]['symbol_right'];
$decimal_place = $this->currencies[$this->code]['decimal_place'];

$currency = $this->code;
}

if ($value) {
$value = $value;
} else {
$value = $this->currencies[$currency]['value'];
}

if ($value) {
$value = $number * $value;
} else {
$value = $number;
}

$string = '';

if (($symbol_left) && ($format)) {
$string .= $symbol_left;
}

if ($format) {
$decimal_point = $this->language->get('decimal_point');
} else {
$decimal_point = '.';
}

if ($format) {
$thousand_point = $this->language->get('thousand_point');
} else {
$thousand_point = '';
}

$string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point);

if (($symbol_right) && ($format)) {
$string .= $symbol_right;
}

return $string;
}
convert($value, $from, $to):
Convert the given value from once currency to other. The parameters are $value means of what amount and $from means of which currency and $to mean to which currency is the value to be converted.
public function convert($value, $from, $to) {
if (isset($this->currencies[$from])) {
$from = $this->currencies[$from]['value'];
} else {
$from = 0;
}
if (isset($this->currencies[$to])) {
$to = $this->currencies[$to]['value'];
} else {
$to = 0;
}
return $value * ($to / $from);
}
getId():
Returns the currency ID.
public function getId() {
return $this->currencies[$this->code]['currency_id'];
}
getCode():
Returns the currency code.
public function getCode() {
return $this->code;
}
getValue($currency):
If the currency is set then returns the value nor it will return zero.
public function getValue($currency) {
if (isset($this->currencies[$currency])) {
return $this->currencies[$currency]['value'];
} else {
return 0;
}
}
has($currency):
Whether the request currency is available or not.
public function has($currency) {
return isset($this->currencies[$currency]);
}

currency converting function, currency library function, converting currency function in class of opencart