Create post-forms such as craigslist on my Django powered website - django

I'm creating a marketplace website such as Craigslist. I'd like to make "post-forms" for users to post their own product information (by uploading photos, adding forms (name, price,condition,,etc.)) on my website' category-page.
Now, I think I can do these things by making use of "Django Permission", but is it correct? If so, how can I do that? Or if not, there are other ways to allow users to do these things ?
The short summary of my website is like below. Specifically,I'd like to know how to allow people to post their products on the category page.
Register & Login
You would have several categories such as furniture, books, games,,, and then, click one of those categories. (I've created this category-page by using "Django admin")
(eg. )
http://bakersfield.craigslist.org/
Then, you can see what kinds of goods are sold on that category page. And then, At the top of website, you can find "Post" button to post our products on the top of my website.
And after click it , you can find "Posting title" "Price" and "upload photos" and many other forms.
(eg)
https://post.craigslist.org/k/7v...
4.After filled those forms,then click "submit" button to post your products pages' link to category page.
Craigslist is the best example for my website.

Related

Add to cart button on luna theme big cartel

How do I stop the "add to cart button" on my products page from redirecting people to the shopping cart page. I would much prefer it to just add the item selected and then allow them to continue shopping instead of forcing them to be redirected. Also, is there a way to add a cart preview drop down to the products page. I would like a preview to drop down and show the cart page each time they add something.
Thank you

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?

A way to create the wall post when creating an album in a group with Facebook Graph API 2.10?

I used to do a POST /group-id/albums to create albums in a group. Then I would POST /album-id/comments to comment on the album. Then I would GET /group-id/feed?fields=comments, and find the id of my comment, and from that have the wall post id. You know, the post that says So and So added 3 photos to the album ...
Using the wall post id, I can delete the album, even though the Graph API does not allow deleting albums directly.
Starting today, the ability to post comments was removed through the API, except for page apps: https://developers.facebook.com/blog/post/2017/07/18/graph-api-v2.10/
Is there any way now, without commenting, to get the album story to the wall?
Here is a partial answer.
This parameter is not documented on the Group album, but it is on the User album. Set 'make_shared_album=true' in the post body. This will make a wall post for the creation of the album, and it looks like it shows up on your feed.
However, I cannot find a way to get that post_id. The post does not show up in the group's feed, oddly, though if you make a permalink to it, the permalink is part of the group. Sadly, the post_id is also not based on the album'd id, so there's no way to guess it.

like detail page inside timeline page tab

I have a facebook timeline page tab app that's running inside an IFRAME on a fan page.
On the main page of the app, we show 10 jobs and users can click through to the detail page of one single book.
We want to add a LIKE button on those detail pages, so that users on facebook can like and share that job in their stream.
The app is totally dynamic so different customers can install the app on their fan page and list their own jobs. (ex. coca-cola installs it on his coca-cola page and lists jobs within the company. then microsoft installs it as well and does the same)
The problem concerns og:metatags and redirection of the liked detail page link, right inside the right facebook company page and relative right detail page showing the job.
I can get these two things done and working but not at the same time:
A. Facebook gets correctly the og:metatags in the head section, with image, title, description when I use the following implementation of the like button (without "data-href" extra attribute)
<div class="fb-like"
data-send="false"
data-layout="button_count"
data-show-faces="false"
data-action="like"
data-font="arial">
</div>
The problem is that not specifying the data-href attribute (and the og:url meta is totally ignored) this is gonna create a link to the current page => intended current page inside an iframe => so the result will be that when you click the shared job on facebook you will be redirected NOT inside the facebook app -right page -right detail page, but to the detail page on the server that hostes the app.
B. If I instead specify the data-href attribute
<div class="fb-like"
data-href=<%= "http://www.facebook.com/pages/:page/#{session[:fb_page_id]}?v=app_XXXXXXX&app_data=#{#job_details.job_id}" %>
data-send="false"
data-layout="button_count"
data-show-faces="false"
data-action="like"
data-font="arial">
</div>
Doing this I can get the right link posted on facebook (so then using &app_data attribute) I can get the perfect redirection working.
BUT on the downside, the og:metatags are totally ignored and instead facebook picks the page tab metatags (top iframe that hostes the pagetab app) and so I get posted on facebook a crap link that tells about a page on facebook with the page app picture. And the even bigger downside is that when you like a job on the app, all the jobs appear to be liked as well (basically the iFrame app becomes the liked page... instead of being the job detail page picked as liked page)
Is out there any genius that knows how to sort this out? I need to get the A an B working at the same time to get the requested result!!!!
Please help!!! :(
I've found the solution myself.
Like button => use href and ref attributes, especially put on the ref the id of your facebook fan page. Passing the current page url will also load and share correctly the og:metatags.
<div class="fb-like"
data-send="false"
data-show-faces="false"
data-layout="button_count"
data-font="arial"
data-action="recommend"
href=<%= "https://app.com/jobs/job_details.job_id" %>
ref=<%= FB_PAGE_ID %>>
</div>
Once you pass the ref attribute to facebook, on your wall the link will be posted by facebook with an extra query string appended with in particular the "fb_ref" parameter:
for example a button with parameters:
href=<%= "https://app.com/jobs/job_details.job_id" %>
and
ref=<%= 332325142248470 %>
becomes:
https://app.com/jobs/a0Ed000000a54bkEAA?fb_ref=332325142248470&fb_source=profile_multiline
when the user clicks the link we want to be redirected back right inside the correct page tab app and right job details page. To achieve this we set up into the controller/show action (that in ruby corrisponds to controller_name/id) a new redirection, remembering that ref will put inside a query string after our href link:
if params[:fb_ref]
redirect_to "http://www.facebook.com/pages/:page/#{params[:fb_ref]}?v=app_xxxxx&app_data=#{params[:id]}"
end
As you can see we create a new dynamic url that will use the "app_data" parameter of the facebook "signed_riquest" (http://developers.facebook.com/docs/authentication/signed_request/) in order to pass to our application the right detail page to be visualized and also redirect us to the right facebook page.
once done this we have just to manage correctly the new app_data parameter that comes now with the signed_request. In my case in one of my main controller I've used:
if fb_signed_request[:app_data]
redirect_to "/jobs/#{session[:app_data]}"
end
And we will see our app loading the right page and the right job detail page!
Hope is gonna help other people!

Magento:How to display drop down attribute on the product listing page

I have created a drop down attribute with a configurable product.
I would like to add in the grid/list product’s page the combo with the choice of my select attribute in order to be able to put in directly from this page the product into my cart wich is impossible for the moment : i have to go on the second page to choose the attribute.
i’ve read a lot of threads but i don’t find a way to achieve it.
thanks for the help.
So you want product "add to cart button" with "custom attributes" to be added to the product listing pages..there's an extension for this, see below:
http://www.mageworx.com/ajax-cart-magento-extension.html
I have only managed to add an "add all item to cart" button and "add to cart" button on my category listing pages.
For the attributes which have a frontend type “Select” we need to define options that on the product page converted into a dropdown. For example attribute color may have options Red, Green, Blue etc. which are defined in the admin area.
We can easily collect all the defined options for any attribute.
// use your own attribute code here
$attribute_code = "color";
$attribute_details = Mage::getSingleton("eav/config")->getAttribute("catalog_product", $attribute_code);
$options = $attribute_details->getSource()->getAllOptions(false);
Foreach($options as $option){
// print_r($option) and find all the elements
echo $option["value"];
echo $option["label"];
}
For more information about magento cart products, visit our Web\Agency-shop