I am building an e-commerce site using spree. I am new to Ruby/RoR and Spree, though not to programming and web development.
I am still carrying out research on logistics, pricing, which products to actually stock up on etc., so I simply want to display product information, and not the price and/or ability to purchase.
I have searched extensively online (to no avail), on how to do the following things I ave listed below:
I want to know how (perhaps, this requires code modification):
NOT show the price of products ANYWHERE on the site (including the product page)
On the product page, NOT show the 'Add to Cart' button
On the product page, SHOW a form that allows the user to register to the site, so that they can be contacted when the product becomes available
I am not looking for detailed steps, simply guidelines that I can follow to make the appropriate changes to the configuration (or code - if required), in order to meet these requirements.
You're going to need to override the view templates.
Try running bundle show spree or bundle open spree if you have an editor setup for bundle, this way you'll know which file you need to change. Its likely going to be somewhere here or in one of the partials, look around.
Then you can override it with deface, see Spree Docs here
If you want override the whole file, then just create the file in your app, for example, if you wanted to override spree/frontend/app/views/spree/products/show.html.erb from the gem.
You'd create the same file with your custom code in it, make sure to follow the same path and naming.
Related
I have a problem where I cannot figure out how to solve.
Lets say i have a company with products. I want to be able to add new products, delete products and edit current products.
I also want to list these projects on a product page.
I know how to add pages and so on. But does this require that i need to create a single page for each product? And then get all childpages information?
I am greatful for any suggestion!
It depends on what you want to do with the products. If you want to have a product detail page, then it makes sense to have a page for each product.
On the other hand, if you want to just list the products and not have a page for each one, you could use something like Archetype, or Nested Content.
It's also worth bearing in mind that if this is going to be an e-commerce site, there are a number of excellent options available that you could use for product management etc. You should investigate uCommerce, Tea Commerce and Merchello for example, to see if they offer the functionality that you require without needed to write too much yourself.
Work through the beginners' tutorial
https://our.umbraco.org/documentation/tutorials/creating-basic-site/
The articles parent and child model can be used for what you need (instead of "Articles Main" you'd have "Product Listing" and "Article Item" would be "Product"). If you don't need a specific page for each product just don't assign a template to the product nodes.
I am tempted to use Spree to build a site where any user will be able to publish a place for rental, or rent a place, in a similar fashion to Airbnb.
People say spree is highly customisable, however most of examples and tutorials are based on a "store" where users only purchase from physical products.
I think that I can edit the Spree::User to grant more permissions so they can also publish. And I may be able to edit the products to include location. Products will be treated as unlimited stock so they are always there.
Then the products listing page will be very changed so that places appear based on user location / search location.
Will I be able to perform all of that or should I start looking other platform?
I have a rails 4 app which contains a model called Projects.
The Projects model has publication options which allow project creators to make the project public, private, or to make a teaser version of the project public.
If the third option is selected, then some but not all of the project details will be visible to some users, whilst the full project will be visible to other users.
How do I approach this? If I create a second layout for the partially disclosed version, can I then yield some of the model attributes and not others? Is there a better way to go about this?
Thank you
I would go about using view based conditions. It gives you one file to edit and adjust for the future and will only render the information that you want the users to be able to access.
- if project.private or project.teaser
#this is my private or teaser information
- if project.private
#this is my private information
#this is my public information
I am building an online poster maker store with Ruby on Rails that gives the customer the option to either download a digital file for a generated poster or to have us print it for them and ship it to them. I am having troubles deciding where in my application to put this functionality. I am using a basic products, line_item, and cart structure.
Do I:
1) Make an option on the checkout that creates an Order if they decide to have us print the poster. If they just want the digital file it would just give them access on their user page after checkout.
2) Make a attribute on my line_item model that saves weather they want to download or print the file.
3) Something else entirely?
Thanks in advance for your help!
I believe I have found a solution! After talking to another developer friend, it hit me that the best solution might be to put all of the attributes for both printed and downloadable posters in the same products model and then expose only the information needed for each particular order.
For example,
If the order is to be printed by us, the user will be asked to fill out a shipping address form and asked what paper they want us to use. If they customer is just going to download the generated poster design these fields in the form will be hidden.
I believe that this is a much simpler solution then the two that I described above and will be the easiest to implement.
Im looking at Rails based CMS's, Refinery looks very nice, clean and simple however I cant find any clarification if templating is possible, or is to be included.
Ive found this pull request. Is this feature now available?
Ive also been looking at Locomotive but the documentation is very sparse at best.
Thanks.
Edit - Sorry, there was not enough of an explanation of what I meant by a template. Is it possible to define the page-parts that a certain page has. Eg I add a "City" page type, which has 5 page-parts, Name, Postcode, Description, Longitude and Latitude. So when a user adds a page, they then choose a page type, in this case a City and that has the pre-defined page-parts in it.
I have seen the copywriting but it does not appear possible to pre-define things when adding a new page.
You could add up layout.css in your stylesheets directory and it will automatically get picked up.
check out this railscast episode for more information.
Edit:
You could use the rails g refinery:engine city name:string ....
It will generate a whole bunch of stuff, follow the instructions printed by this command and you could see a new admin page to CRUD cities and a new app with views to set the HTML of show/index pages.