How to programmatically add a product variation to the cart in Drupal commerce 2.x (Drupal 8)

Playing a bit with Drupal commerce in Drupal 8, we notice that several functions that we used to use in the past with D7 are gone in D8, or they've had several changes, dued to the new API.

Drupal commerce has lots of changes. The new concept give us more flexibility and features (for example, we don't need a content type to display our products, because they have now their own display page, the product variations are now in commerce core, or the Store concept.).

TableField

The TableField module provides a simple, generic form/widget to input tabular data. The form allows the user to select the number of rows/columns in the table, then enter the data via text fields. Since this is a field it is revision capable,multi-value capable and has integration with Views.

Drupal 8 Release

Viewfield 8.x-3.x

The Viewfield module defines an entity reference field type to display a view. Viewfield enables an administrator or content author to integrate a views display into any fieldable entity, such as content, users or paragraphs. In addition, through the use of the Always use default value setting, the same view(s) may automatically be placed into all entities in a bundle. Viewfield has considerable theming support, making it easy to customize presentation.

BS Base

@TODO - this will be a documentation for bs_base base theme.

In the meantime check theme README.md for current up to date theme documentation.

Drupal 8 SEO

Sub-title: 
The Visual, Step-by-Step Guide to Drupal Search Engine Optimization
Authors: 

Ben Finklea
with Foreword by Dries Buytaert

Publisher: 
Volacci Corporation
Publication date: 
2017-01
Page count: 
298
ISBN-13: 
978-1-946017-0

Drupal 8 is great for SEO…if you know which modules to install and exactly how to configure them. That’s where Drupal 8 SEO comes in. With over 150 images to guide you every step of the way, this book delivers the knowledge you need to get your site listed and ranking high in the search engines.

Learn how to Search Engine Optimize your Drupal 8 website with this visual, step-by-step guide. Get the exact modules, settings, and configurations your site needs to get the best possible rankings in Google and other search engines.

Drupal 8 SEO is a brand new offering from Ben Finklea that will teach marketers and developers what’s needed to make Drupal 8 deliver perfectly optimized web pages. Generate traffic, leads, and revenue like never before with Drupal.

Created to accompany the Drupal 8 SEO Checklist module, this book takes you through the exact steps that Ben has used for years to get top results for both national brands and small companies. It explains the SEO process created by the experts at Drupal SEO agency, Volacci, and how it can be used by any organization large or small to grow traffic, leads, and revenues. The process covers:

• Drupal 8 SEO Checklist
• Tools to do SEO faster
• Redirects
• URLs and paths
• Title tags and Metatags
• XML Sitemaps
• Setting up Google Analytics the right way
• Schema.org for enhanced Google listings
• Better internal linking
• Validating HTML and CSS
• Fixing broken incoming links
• Page-by-page keyword optimization
• Figuring out what worked in Google
• How to secure and speed up Drupal for higher rankings
• Mobile ranking with AMP
• Social link building with AddToAny
• …and more!

Heavy on how-to and light on long explanations, this book is for the marketer or site owner who wants to hit the ground running without a lot of reading or time spent learning SEO basics.

With over 150 images to guide you every step of the way, Drupal 8 SEO delivers the knowledge you need to get your site listed and ranking high in the search engines.

Still not sure if you need this book? If at least 3 of these are true, this book is for you:

1. You’ve got a Drupal 8 website. Either you took it over, your company built it, or you’re about to launch a new endeavor and Drupal 8 is the right technology you need to get the job done.
2. You need a Drupal 8 SEO shortcut. This book is the shortcut to getting your Drupal 8 website optimized, ranking, and working for your business.
3. You already use the Drupal 8 SEO Checklist module. I created this book to be a supplement to the SEO Checklist module for Drupal 8. If you’re already using the module, this book is for you.
4. You’ve invested a lot in Drupal 8 already. All the hard work your team has done to create a great website will go to waste if you don’t generate a steady flow of customers ready to buy, sign up, or join.
5. You’re not looking for an SEO education. This book is short on SEO “whys” and long on Drupal 8 “how-tos”. Instead of rehashing common SEO concepts, I’ve linked to trusted online resources that explain the basics.
6. You’ve SEO’d another platform and need to SEO Drupal. Drupal does SEO differently. This book will empower you to be more productive and successful using Drupal best practices (also known as The Drupal Way).
7. You can implement a solid SEO strategy yourself. This book will help you implement that strategy.
8. You need to rank in the search engines. Ranking well in Google matters. A lot. It’s not an afterthought - or at least it shouldn’t be - it’s at the forefront of your mind as a marketer.
9. Winning matters to you. Companies that rank well in Google win. Companies that don’t rank are not even in the running - it’s just that simple.
10. You’re a visual person. They say a picture is worth a thousand words so there are over 150 Drupal 8 screenshots in this book. My goal is for you to see exactly what to do, where to click, and how things work.

If you’re ready for results with the minimum of hassle, Drupal 8 SEO will lead the way to a successful SEO marketing campaign on your website.

Pages

Subscribe with RSS Subscribe to RSS - Beginner