Sunday, April 17, 2011

Need help on the opencart about the price changing in the cart




My price changes as per the customer login i am successful to change in the product display but what i now need is that how do i make changes in the cart and the confirm page.

I have added the "product_price_customer" table in the database and which contain the

CREATE TABLE IF NOT EXISTS `product_price_customer` (
`product_price_customer_id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL,
`price` float NOT NULL,
`customer_id` int(11) NOT NULL,
PRIMARY KEY (`ppc_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;


Need Quick Help

Thanking You

www.dgcpack.com

http://rupaknpl.blogspot.com

Saturday, April 16, 2011

Rajnikanth funny videos from you tube











Rajnikanth funny video

Opencart Views






Opencart Views

A Opencart view is simply a web page, or a page fragment, like a header, footer, sidebar, etc. In fact, views can flexibly be embedded within other views (within other views, etc., etc.) if you need this type of hierarchy.
Opencart Views are never called directly; they must be loaded by an opencart controller. Remember that in an MVC framework, the Controller acts as the traffic cop, so it is responsible for fetching a particular view. If you have not read the Opencart Controller page you should do so before continuing.
Using the example controller we created in the opencart controller page, let's add a view to it.

Creating a View

Opencart View is located in the

catalog/view/theme/template_folder_name/template/subdirectory/file_name.tpl


The extension of the opencart view file is .tpl
Now on the file we write the html code.

Save the file as hello.tpl in the 

catalog/view/theme/template_folder_name/template/subdirectory/

Let me describe the view file the variable is defined in the controller and the $header is the path to the header file as





Loading a opencart view or Loading multiple views

 

$this->children = array(
                                'common/column_right',
                                'common/column_left',
                                'common/footer',
                                'common/header'
);
This will automatically load the header, column_right, column_left, footer and header.
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) {
 $this->template = $this->config->get('config_template') . '/template/product/category.tpl';
} else {
$this->template = 'default/template/product/category.tpl';
}
These lines in the controller say that load the file if it does not exist        

What is a Controller in Opencart?






What is a Controller in Opencart?

A OpenCart Controller is simply a class file that is named in a way that can be associated with a URI.
Consider this URI:
rupaknepali.com/index.php?route=account/account
In the above example, Opencart would attempt to find a controller named account.php in account folder and load it. Your file will be included in the
catalog/controller/account/account.php
rupaknepali.com/ admin/index.php?route=sale/customer
Here the file loaded will be:
admin/controller/sale/customer.php
When a controller's name matches the first segment of a URI, it will be loaded.

Let's try it:  Hello World!

Let's create a simple controller so you can see it in action. Using your text editor, create a file called hello.php, and put the following code in it:
Then save the file to your catalog/controllers/account/ folder.
Now visit your site using a URL similar to this:
rupaknepali.com/index.php?route=account/hello
If you did it right, you should see Hello World!.
Note: Class names must start with an uppercase letter. In other words, this is valid:

class ControllerAccountHello extends Controller {

}
?>
This may not be valid:

class controllerAccountHelloextends Controller {
}
?>
Also, always make sure your controller extends the parent controller class so that it can inherit all its functions.

Functions

In the above example the function name is index(). The "index" function is always loaded by default if the second segment of the URI is empty. Another way to show your "Hello World" message would be this:
rupaknepali.com/index.php?route=account/hello/index
The second segment of the URI determines which function in the controller gets called.
Let's try it. Add a new function to your controller:
Now load the following URL to see the comment function:
rupaknepali.com/index.php?route=account/hello/comments
You should see your new message.

example in opencart, controller example in the opencart, learn opencart by example, how controllers work in opencart?,what is controller in opencart,opwncart

Model-View-Controller in Opencart






Model-View-Controller in Opencart
Opencart is based on the Model-View-Controller development pattern. MVC is a software approach that separates application logic from presentation. In practice, it permits your ecommerce site which will contain minimal scripting since the presentation is separate from the PHP scripting.
  • The Model represents your data structures. Typically your model classes will contain functions that help you retrieve, insert, and update information in your database.
  • The View is the information that is being presented to a user. A View will normally be a web page, but in Opencart, a view can also be a page fragment like a header or footer. It can also be an RSS page, or any other type of "page".
  • The Controller serves as an intermediary between the Model, the View, and any other resources needed to process the HTTP request and generate a web page.
Opencart has a fairly loose approach to MVC since Models are not required. If you don't need the added separation, or find that maintaining models requires more complexity than you want, you can ignore them and build your application minimally using Controllers and Views. Opencart also enables you to incorporate your own existing scripts not needed to follow the patterns but it will effects when you wanted to upgrade the Opencart  If we follow the patterns then it will be easy for us and the system.

Design and Architectural Goals with the reference of E-commerce

The goal of Opencart is to maximize the performance, capability, and flexibility in the smallest, lightest possible package.
To meet this goal programmers are committed to benchmarking, re-factoring, and simplifying at every step of the development process, rejecting anything that doesn't further the stated objective.
From a technical and architectural standpoint, Opencart was created with the following objectives:
  • Dynamic Instantiation. In Opencart, components are loaded and routines executed only when requested, rather than globally. No assumptions are made by the system regarding what may be needed beyond the minimal core resources, so the system is very light-weight by default. The events, as triggered by the HTTP request, and the controllers and views you design will determine what is invoked.
  • Loose Coupling. Coupling is the degree to which components of a system rely on each other. The less components depend on each other the more reusable and flexible the system becomes. Our goal was a very loosely coupled system.
  • Component Singularity. Singularity is the degree to which components have a narrowly focused purpose. In Opencart, each class and its functions are highly autonomous in order to allow maximum usefulness.
Opencart is a dynamically instantiated, loosely coupled system with high component singularity. It strives for simplicity, flexibility, and high performance in a small footprint package.

MVC description of the opencart, opencart design and architectural goals

Wednesday, April 13, 2011

Collection of opencart functions that are very useful for ecommerce development






$this->cart->remove($key):
Remove the cart value
$this->cart->update($key, $value):
Update the cart value
$customer_id=$this->customer->getId():
The $customer_id is the logged in Customer ID
$this->request->get[‘get_data’]:
This acts as the $_GET
$this->session->data[‘session_data’]:
This acts as the $_SESSION
$this->request->post[‘post_data’]:
This acts as the $_POST
$this->document->title:
This returns the document title.
$this->document->keywords:
This returns the keywords at the title of the page which is not shown in the document means acts as the meta keywords.
$this->document->description:
This acts as the meta description and will directly located in the head section of the pages.

$this->customer->isLogged():
Check whether the customer is logged in or not

collections of opencart reserved keywordk, opencart functions collections

Tuesday, April 12, 2011

What i have talked with my friends on 2011-04-12






Respected Sir,

Things I have done on the DGC packs are:

·         CSV upload for the tax and city
·         Calculation of the total amount in the confirm page with the Tax rate according to the city input
·         View History is also done and the view invoice is also completed.
You can have a look by logging in and clicking in the “View your order history” in the My Account Page
·         Now I am working in the price management when the customer logged.

Thanking You,
Rupak Nepali

[Rama Shrestha]
Report · 3:54pm
oe k ta cha
aaajja bida chaina
[You]
Report · 3:57pm
chaina yar ajja ko satta ma friday bida ho
exchange offer..
ani OT kamaudai ho...
[Rama Shrestha]
Report · 4:04pm
ho yar .....garnai paryo ........
[You]
Report · 4:04pm
la la extra income bhayoo flim heryara pain..
[Rama Shrestha]
Report · 4:11pm
hah k vane ko
[You]
Report · 4:12pm
world link ma gayara flim heri heri paisa kamaudai chan bhanakoo..
[Rama Shrestha]
Report · 4:12pm
yup man
khaapar ta leyara aako ho hagi
hahahahahahahahah
tara fck yo flim hera pani chitta na bujen yar
[You]
Report · 4:13pm
kasto hernu paryoo ta
[Rama Shrestha]
Report · 4:13pm
vaya pani na vay pani
i dont mean
that
kaati hernu film
aaba ta dikka lagcha
[You]
Report · 4:14pm
a la la ani new year plan k cha ta
[Rama Shrestha]
Report · 4:14pm
chaina
yar
film herna aaunu parch worldlink ma
[You]
Report · 4:14pm
kai ta garnuuu paryoo ne
ha ha ha ha
[Rama Shrestha]
Report · 4:15pm
aabo k garne ta film herne ani basne
la la plan banau na ta
after 6 pm pachi
[You]
Report · 4:15pm
ajja timi ghar ma nai ho ne
[Rama Shrestha]
Report · 4:16pm
kasi ko party palace ma basau na no ma
hoina flim herdai chu
wlink ma
[You]
Report · 4:17pm
timi ghar ma kati bajee pachii huncha bhanakoo
[Rama Shrestha]
Report · 4:18pm
after 10 pm
[You]
Report · 4:19pm
natra bhetyara plan garnee bhanakoo..
kurai milana
[Rama Shrestha]
Report · 4:19pm
kina k vayo
[You]
Report · 4:20pm
hoina natra new year ko plan garnuuu hunthyoo bhanako
[Rama Shrestha]
Report · 4:21pm
la yehi gare vae halcha ni
la k garne
just meet BOKA ani 1st baishak ma after 6 pachi ghumna jaula
[You]
Report · 4:22pm
la la
[Rama Shrestha]
Report · 4:24pm
la give me mis call ani will cal back
[You]
Report · 4:24pm
la la
[Rama Shrestha]
Report · 4:25pm
la brother aaja ko din pani gayo hoina ta its 4:30 pm
aba remarks k hale bichar cha

==================================
a says:
hi Rupak
how are you?
rupak says:
fine sir
what i am doing is calculate the tax as in the bigdotprint in the DGC
a says:
ok great
did you get the point about the header in cotton candy page?
rupak says:
i have changed it
a says:
yeah I see
thanks!!!
rupak says:
and i am confused do we have to make the zooming in it also
a says:
I am not sure yet
client has not instructed me so we'll wait
rupak says:
ok sir
now what i want to knnow is that whether the taxx is changeable or not
a says:
yes it is
rupak says:
and the city name
a says:
well it will be CSV uploaded each year
like I have sent you
rupak says:
ok...
a says:
tax change each year
but city should remain the same
only that csv will change
rupak says:
got it..
today i will work this making CSV to upload and downlaod and pricing in the total amount
a says:
ok
thanks
rupak says:
can i know about the price showing in the products when the customer login...
a says:
sure what do you want to kniw
rupak says:
for the employee which price are we showing
of the super admin price
a says:
if employee or super admin signs in it shows price for their company
rupak says:
ok thanking you have sweet dream..



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