Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
i need to display Product Weight under Product price in the single product page & search page on OpenCart 3.0.2.0 .
How i can do that ?
This is relatively simple if you understand the MVC (Model, View, Controller) pattern. Here are the steps required:
You need to add the logic for fetching the product weight in the controller file and pass it to the view catalog/controller/product/product.php
On line 283 (right after the price because it is a nice place for it) add this code
$data['weight'] = $product_info['weight'] + 0 ;
(the + 0 removes the zeros and makes it looks nicer)
Then you need to display it in your view template file catalog/view/theme/default/template/product/product.twig
on line 162 add:
{{weight}}
If you don't see the changes, that is because you have twig Cache turned on. Go to admin/dashboard and on the top right corner find the gear button. click it and click refresh cache. you can also turn off the cache while you are in development mode. http://joxi.ru/LmGewYZiwBW0zA
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
i've a question and need your help
i have a empty form with about 10 input fields. all i want to do is :
if a user fill in the user's login name and hit the tab key - the other fields should be filled out with the related data stored in the database. like users location, email etc.
could some give me a cfml related example please?
Here is how to approach this:
Use javascript to check for on tab event ( key press for the tab key )
Call a cfc, passing the value of the input field to the cfc
query the database for a field that matched exactly that data
return the data as json and populate the rest of the fields.
Assuming you have basic javascript and cfml skills this would be the way I would approach this.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have link on ID column, when user click on link there is an EDIT button.
When click on EDIT user can make changes.
But, I want to ensure that two users can't edit in same time, and when one user click on edit that all users can't see edit button till save/commit record.
Also to leave message eg. Record is editing by another user, please try later.
I can add one column in table eg. editing number(1), but how to change this column to 1.
when user click on EDIT button?
To give an answer on you question:
You can create a dynamic action which will be triggered on pageLoad. That DA should then update the column to 1 or Y.
!! Warning:
But how will you make sure, that the column will be updated back to 0 or N? Buttons and actions which closes the modal, can update the column back to its initial state, but the X - Close Window button won't. And what if your browser closes or crashes?
In that case, you would be left with a record, which can't be edited anymore by anyone, since that record is still indicated as currently being edited.
I strongly advise not to go down that road!
Instead, trust Oracle APEX's Prevent Lost Updates and Lock Row mechanism's. These are available in the Settings part of the Automatic Row Processing process.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
As of now i am facing some problem with field bind issue while get the response from coveo, inside the this method ToCoveoFieldName is implemented. Any one can help me on this.
Code snippet
raw.<%= ToCoveoFieldName("field Name", false)
Since you are having issues with this call, I am assuming that you might be migrating to the Coveo for Sitecore Hive Framework implementation, which mostly shifted from a back-end implementation to a front-end one for all of its major field logic.
This means that ToCoveoFieldName is not available any more on the server side. Instead, there is a JavaScript implementation of the same logic.
For instance, if you want to translate a field to the Coveo format, you can use CoveoForSitecore.Context.fields.toCoveo("field name").
I can see in your question that you are within a result template, there are already two helpers to get you either the field name or the value.
<div data-field={{= coveoFieldName("field name") }}>
and
<div>{{= coveoFieldValue("field name") }}</div>. (This one is the equivalent of calling raw[coveoFieldName("field name")])
Those helpers are explained in more details in the documentation, on the Editing the Content of a Result Template page (for version 5.0+) and Coveo Fields Resources Component page (for versions <5.0 and 4.1+).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
In postman {{url}}:8001/api/{{version}}/auth/login Where can i find the actual value of {{url}} in POSTMAN
If you have {{url}} in your request path and this is red, this means that you do not have a environment or global variable value set.
If you have a value set for this variable name, it will be orange and by hovering over the {{url}} value, you will see the set value displayed in a pop up box.
This can also be viewed in the 'Environment Quick View' by pressing the 'eye' icon, on the right side of the application.
More info on Postman variables can be found here: https://www.getpostman.com/docs/v6/postman/environments_and_globals/variables
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to create a form that does the following: the user specifies the number of questions that they want to ask and then on the next page, the user is able to fill out the relevant details pertaining to the number of questions that they to ask. I was wondering if there is a simple way to do this using django forms?
My approach is as follows:
I use one form to record the number of questions that the user wants to ask with a general description, then when the user clicks submit/next, the next view would create a form with those number of questions; however, I'm running into a complication when trying to use this method. I want to link the first form to the second form, but not sure how to because I can't preserve any information in the view from each call.
Is there a better way of going about this problem?
You certainly can preserve information between views. Perhaps the easiest way to do this is in URL parameters; your first view can redirect to "/second_view/?number_of_questions=5" and the second view can access request.GET['number_of_questions'].
An alternative, which is particularly useful if you have a lot of data, would be to use the session; add the data to the session on submit in the first view, and pop it out in the second.
In Django 1.8, the django.contrib.formtools module was moved into a separate package, django-formtools. It includes the FormWizard, which is the standard tool you'd use to create a form that spans multiple pages and/or steps.