Add upload photo or file field to opencard 1.5.X - opencart

How can I add a custom image or file upload field to opencart customer registration page?
I use opencart as mijoshop (a joomla component).

you can get idea from catalog/product.tpl & catalog/product.php

Related

Adding a multiple Image gallery to a page with text?

I'm learning Wagtail and I'm trying to make a basic Ecommerce style site. The layout will be:
Home Page
-> Products
-> Product 1
-> ...
-> Product N
-> About
-> Contact
In the Product page I want to have a Title, Description, Picture gallery or just display a few pictures and eventually tags (But this post is about the Images). I have checked this Documentation which explain how to add Abstract Images in the View but it leaves me confused on what to import and add to the model, what type? when I just want to add 1,2...n Images on a Product page. The documentation only explains how to add an Image into a form and it leaves me wondering should I use a Django type or Wagtail type?
How would I add the ability to upload/remove images from the admin console Product page?

How to get the text file which is uploaded from android device and store it in a folder using django?

I want to save the text file or zip file in folder which can be uploaded in mobile devices(Android,IOS) using django framework.How to get the file in request ? Thanks in advance
If i got your question, this should be the answer. In your models.py file add a column for storing this upload:
yourfield = models.FileField(upload_to=path_of_the_folder_where_you_want_to_save)
And make the form on this model.

Illustrated texts in Django model

I am trying to make one Blog using Django 2.0 and I have already created a primitive one. It has a Post model which is as follows:
class Post(models.Model):
PriKey = models.CharField(max_length=255,primary_key=True)
Heading = models.CharField(max_length=100)
DateOfPost = models.DateField(default=datetime.date.today())
Content = models.TextField()
As it can be seen, the content area is only textual and as of now, I can't add any special style or pictures inside my content.
I thought of using HTML tags inside the text content but they are appearing unchanged when the web page is rendered.
So my question is, is there any way of storing pictures along with the text in the content field of the Post model? I want to make something like this
Is there any way of showing the pictures in their respective positions using Django model? If no, is there any other way of doing this?
Also, is there any way of storing HTML codes inside django models and render them as it is when the website is run?
You can store html tags inside the field.
while rendering, to template mark it as safe
{{ post.content|safe }}
This will render all the html tags.
But this is not a good way as it makes you vullerable to cross site scripting attacks
A better method is to use something like a ckeditor
It provides a RichTextField and RichTextUploading Field and using this you can upload pictures, videos, code snippets, style your text and a lot more inside one field.
There are many other optons, but I prefer ckeditor
Ckeditor is a cross platform editor, django-ckeditor is a library containing django implementation of ckeditor which gives you full backend and frontend combined
ckeditor
django-ckeditor
django-pagedown A django app that allows the easy addition of Stack Overflow's "PageDown" markdown editor to a django form field, whether in a custom app or the Django Admin
I think you should give it a try
Cheers :)

Opencart product.tpl

Where did I miss to add a line of code if I try to echo php variable inside OPENCART product.tpl file and it doesn't show up on site?
Notes: there is a field in database. I am able to save to this field from admin panel ( i added a custom field there).
Did You edit also the product controller to load the variable and pass it to the template? I guess not... Edit catalog/controller/product/product.php and add $this->data['MYVARIABLE'] = $product_info['MYVARIABLE']; somewhere before $this->render() is called.

How to ad an extra field to joomla 2.5 registration form?

I want to add an extra file uploading field to joomla 2.5 registration form for uploading the photos of the users :
You have to:
1) Modify the file components/com_users/models/forms/registration.xml and add extra fields to it.
2) Modify function register($temp) in components\com_users\models\registration.php so you can save path / paths to your file / files.
3) Maybe add additional table in your database or add columns to #__users table