V
V
virus72019-02-05 14:18:23
PostgreSQL
virus7, 2019-02-05 14:18:23

How to display attribute value on single woocommerce page?

Hello !
It is necessary to somehow display the value of the attribute on a separately created page without a plugin, is this possible?
woocommerce

Answer the question

In order to leave comments, you need to log in

6 answer(s)
S
sim3x, 2016-07-09
@sim3x

https://en.wikipedia.org/wiki/Entity%E2%80%93attri... The
database is designed for the project, not for the framework

C
ComodoHacker, 2016-07-09
@ComodoHacker

I would create one table for the common attributes and an additional one for each category's unique attributes.
The EAV model will not work, because you will most likely need to implement complex filters on attributes. In the EAV model, this will be difficult, and it will not work quickly.

C
Chronic 86, 2016-07-09
@chronic86

computers.gif
the picture is impudently stolen from www.sql-tutorial.ru
something like this will suit you....
to make one big table? this is not your case as there will be a lot of empty fields.. for example for a car there will be empty fields in the RAM columns, etc.

A
Anton Dyachuk, 2016-07-10
@Renius

If I understood your problem correctly:
1) you want a form to fill in the product characteristics when the form corresponds to the product category
2) you want a product demonstration form in the form of the appropriate category
then:
structure#

hash: { 
title: 'вес', measure: 'кг', ....
title: 'CPU', mesure: 'false' #вроде вы будете писать характеристику? просто строкой
title: 'люк', behavior: radio_button, values: %w(есть нет)
# ипт, можно любым образом организовать

That is, the data structure of the product category can (I would) be stored in the category itself.
With this kind of category, you will know how to build a form and how to display a product.
  • product_id
  • title: hatch
  • measure
  • value: true
  • behavior: radio/checkbox etc

O
OnYourLips, 2016-07-09
@OnYourLips

EAV pattern: https://en.wikipedia.org/wiki/Entity%E2%80%93attri...

A
anasasiakiri4enko, 2016-07-13
@anasasiakiri4enko

I will offer my solution:
rails g model title:string about:text category:string img:string
One common database for all products, just send the category of the options you need to the database when creating the product (in the submission form, just add the usual select ['first category) helper , 'second category]). For example, on the all items page, show all products. And if you need to sort by categories, then create a new controller and pull all the products of the category you need in it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question