Display Product Variants on a page in Shopify - html

I am looking to find out how i can display a products variants on a page in Shopify. Currently I have a page where I have hard coded a products quantity and size and then linked the price to the product page where the dropdowns for the variants are then predefined.
The problem is that if any variants are changed or any new ones are added then this will not reflected unless its hard coded, hence I need to have some sort of automation so the page correlates what it is available.
From what I know I would probably need to write a custom template, but not sure how i can go about doing this.
The following is an example of what I am looking to do.
Product - Cards
Quantity - 5 10 15 20 25
Style - A A A A A
Would appreciate it, if anybody is able to help or guide me as to how i can do this.
Thanks in advance.

1). You can check with old backup files
2). Created new test store and check product.liquid file
Shopify provide script to get variant in it's default file.

Related

Automatically assigning a (minor/major) version to updated files in powerautomate / SharePoint

I have a library with sharepoint and im trying to do the following:
When a file has been modified or updated i want to increment the version, i want to increment the major version so V X(+1).00 if 250 or more amount of words has been changed or added. Below 250 i want to increment the minor version so V1.xx(+1). I tried lots of docs but i cant find the solution. Anyone who does know the sol. Or a good alternative?
I already tried different workflow but no outcome
Thanks in advance PowerAutomate geeks

Search HTML Tables on Multiple Pages

Hello Stack Overflow Community!
I am making a directory of many thousand custom mods for a game using HTML tables. When I started this project, I thought one HTML page would be slow, but adequate for the ~4k files I was expecting. As I progressed, I realized there are tens of thousands of files I need to have in these tables, and let the user search though to find what they are missing to load up a new scenario. Each entry has about 20 text entries and a small image (~3KB). I only need to be able to search through one column.
I'm thinking of dividing the tables across several pages on my website to help loading speeds and improve overall organization. But then a user would have to navigate to each page, and perform a search there. This could take a while and be very cumbersome.
I'm not great at website programming. Can someone advise a way to allow the user to search through several web pages and tables from one location? Ideally this would jump to the location in the table on the new webpage, or maybe highlight the entry like the browser's search function does.
You can see my current setup here : https://www.loco-dat-directory.site/
Hopefully someone can point me in the right direction, as I'm quite confused now :-)
This would be my steps,
Copy all my info into an excel spredsheet, then convert that to json, then make that an array for javascript (myarray), then can make an input field, and on click an if statement if input == myarray[0].propertyName
if you want something more than an exact match, you'd need https://lodash.com/
in your project.
Hacky Solution
There is a browser tool, called TableCapture, to capture data from html tables and load into excel/spreadsheets - where you are basically deferring to spreadsheet software to manage the searching.
You would have to see if:
This type of tool would solve your problem - maybe you can pull each HTML page's contents manually, then merge these pages into a document with multiple "sheets", and then let people download the "spreadsheet" from your website.
If you do not take on the labor above and just tell other people to do it, then you'd have to see if you can teach the people how to perform the search and do this method on their own. eg. "download this plugin, use it on these pages, search"
Why your question is difficult to answer
The reason why it will be hard for people to answer you in stackoverflow.com (usually code solutions) is that you need a more complicated solution (in my opinion) than hard coded tables and html/css/javascript.
This type of situation is exactly why people use databases and APIs to accept requests ("term": "something") for information and deliver responses ( "results": [...] ).
Thank you everyone for your great advice. I wasn't aware most of these potential solutions existed, and it was good to see how other people were tackling problems of similar scope.
I've decided to go with DataTables for their built-in sorting and filtering : https://datatables.net/
I'm also going to use a javascript array with an input field on the main page to allow users to search for which pack their mod is in. This will lead them to separate pages on my site, each with a unique datatable for a mod pack. Separate pages will load up much quicker than one gigantic page trying to show everything.

Is it possible to create variables on page1 and use that variable on page2? (Without the use of extensions)

I know it’s possible to create a template and have parameters, which can be used to customize another page. What I need to satisfy my colleagues, without the use of extensions, is to define variables in page1, such as end date, classification which i can use the variables on page 2. Similar as the use of template {{:page1|ParameterX|ParameterY}}.
My colleagues want to edit page1 (which consists all the details of a project)
Upon updating page1, they want page 2(which consists of an overview of many projects) to update with the information from the updated page1 data.
For example the project - end date has changed.
So the end date in page 2 of that specified project has changed too.
Thanks in advance.
As far as I know, this is not possible within traditional MediaWiki. One way to get the same effect would be to do as you suggested and work with templates. If multiple pages had the same information, you could use the common template, Template:2018 Project X - End Date as an example. Of course, with many variables, this could quickly become a messy approach. You could also create a template that has all the common information filled in and only requires input of differing information.
The alternative would be to simply have all the information verified by users across several pages.
A final potential option I am less familiar with, but which I believe may have a solution to your problem is using Semantic MediaWiki. It is a big extension, but a powerful one that may solve this and other problems down the line.

Restricting multi category to set number according to select package

I am helping a client build a wordpress directory. The theme in use is ListingPro. My client is wanting to restrict the number of categories allowed according to the package selected.
for example:
Gold package - No. of catergories allowed: 5
Platinum package - No. of catergories allowed: 10
At the moment, the theme allows for all categories to be selected.
I dont have the coding knowledge to make this happen. I am looking for advice, help or a direction I should look at for help.
I can't say for sure without digging into this plugin's code, but I'd start by looking through and seeing where and how it stores the information of listings.
Basically, you're looking to intercept the function that posts a listing, and you'll want to do a get_posts (https://developer.wordpress.org/reference/functions/get_posts/) request that sees how many posts attributed to the logged in user has made with any given category.

Replacing a line of HTML with a database entry in a specific format

Before I explain the issue, I'd like to say I can code in HTML and CSS, so if you could offer a solution using those I'd be very pleased as I'll be fully able to customize it. Don't be afraid to use other languages though... Everything is welcome.
I've been searching around and I find a lot of similar questions with their respecive answers, but none quite matches what I need, so here I go.
I'm building a website for a person who sells handmade stuff. So far, the idea is to show a simple gallery of all the items in stock, but since this stock is constantly changing, I need a way to reflect these changes on the site, easily. Furthermore, it'd be even nicer if the seller himself could update the gallery without having to mess with the code on the actual site. Therefore, I plan to add a simple tag in the main page, to be replaced with the data (as written by the seller), but displayed in a specific format I'll probably have to write in a separate file... This is where my problems begin.
So, the site has a /images folder where a single picture for each of the items is stored, and the file the seller is supposed to modify should include the item's name, filename of its picture, dimensions, price, a short description, and maybe the amount in stock. For each item. I don't even know what file format to use, since I'm not experienced with databases at all.
I need this data to be displayed in a particular pre-set way, with all the items clearly visible at once (using the browser's scrollbar), and without the need to edit any line of code anytime the amount of items varies as I can't just be watching the site at all times. I don't know how to do that, so any ideas would be much appreciated. Thanks!
Edit: Here's a sample of a little placeholder code I made just to see how things could fit, in case it can be used.
<td class="thumb"><img src="images/tarjetas/2011/T01.JPG"><br><b>$2500 | Cód.: T01<br />16 x 11,5 cm<p /></b></td>
<td class="thumb"><img src="images/tarjetas/2011/T02.JPG"><br><b>$3500 | Cód.: T02<br />19 x 14 cm<p /></b></td>
<td class="thumb"><img src="images/tarjetas/2011/T03.JPG"><br><b>$2500 | Cód.: T03<br />17,5 x 12 cm<p /></b></td>
<td class="thumb"><img src="images/tarjetas/2011/T04.JPG"><br><b>$3500 | Cód.: T04<br />16 x 13 cm<p /></b></td>
As above. Learn php/mysqli. You need to create an admin side to the site where the owner can add entries to a database and then a client site side that customers can see which calls on the entries you added on the admin side.
It all depends on how much time you have as databases and php are not impossible to learn quickly. However if your taking money it will need to be secure. Look up pdo and prepared statements for your database interactions with MySQL.
If time is an issue just get a shopping cart plugin or use I think open source shopping carts into google etc and there will be plenty of choice.
You could also use a complete eccomerce solution like magento. Again type in CMS ecommerce software. There are great free ones.
Wordpress, joomla, Drupal are all open source CMS systems that also have shopping cart solutions (some paid). If you have time though learn php MySQL it open up so much functionality. I'm learning it myself and the database side of it opens up so many site possibilities.
Then Why don't you go for open source free shopping cart there are lot many free shopping carts available like Avactis,prestashop,magento etc
For this, my friend, you are going to have to learn forms and PHP. Go to a good and basic website like w3schools.com and start learning. I do not think such a thing would be possible without PHP as it is a server-side language. This means that it handles interaction with the server.
What I think you should do is add a link to another page where this a form that requires you to upload a picture and describe it.
Another thing is, if you want constant updating of the list of things you can buy, you might want to look into AJAX.