Month: March 2025

Set value in datalist

User Assistant You can set the value of an “ field based on a selection from the “ in JavaScript. Assuming you have an “ element that uses the “: ### Example: <input type="text" id="product_input-<?php echo $product->get_id(); ?>" list="product_code-<?php echo $product->get_id(); ?>"> <datalist id="product_code-<?php echo $product->get_id(); ?>"> <?php if(is_array($p_sku) && count($p_sku) > 0){ foreach($p_sku as […]

Firebase portfolio Vue 3

User Firebase default database add/display portfolio with image vue 3 Assistant To add and display a portfolio with images in a **Firebase Realtime Database** using **Vue 3**, follow these steps: — ## **1. Set Up Firebase** Ensure you have Firebase set up in your Vue 3 project. 1. Install Firebase SDK: npm install firebase 2. […]

Get Variation ID By Attribute

User How to get variation id based on if ($attribute->is_taxonomy()) { $terms = wc_get_product_terms($product_id, $attr_name, ['fields' => 'names']); foreach ($terms as $term) { $filterOption .= '' . esc_html($term) . ''; } } attr term value Assistant To get the **variation ID** based on the selected attribute term value, you need to match the attribute term […]

HTML Entity Conversion

User _legheight_field 7/8" convert 7/8" to 7/8" when get_post_meta Assistant When retrieving the `_legheight_field` meta value using `get_post_meta()`, you need to replace `"` (which is the HTML entity for `"` double quote) with the actual `"` character. You can use `html_entity_decode()` in PHP to achieve this. ### Solution: $legheight = get_post_meta($post_id, '_legheight_field', true); $legheight = […]

Hide Datalist on Hover

User hide datalist by default on hover arrow drodown Assistant To hide a “ by default and only show it when interacting with an associated “ or when hovering over an arrow dropdown, you can use CSS and JavaScript. Here's a simple way to achieve this: ### **Approach** – Hide the “ by default. – […]

Firebase Token Laravel API

User const getFirebaseToken = async (provider:string) => { try { // Sign in with Google or GitHub const result = provider === "google" ? await signInWithGoogle() : await signInWithGithub(); //console.log(result); // Get Firebase ID token const idToken = await result.user.getIdToken(); console.log(result.user.displayName, result.user.email, result.user.photoURL, result.user.uid); const userData = { name: result.user.displayName, email: result.user.email, avatar: result.user.photoURL, firebase_uid: […]

Google GitHub Login Vue 3

User google/github login vue 3 js Assistant To integrate Google and GitHub login in a **Vue 3** application, you can use Firebase Authentication or implement OAuth 2.0 manually. Below are both approaches. — ## **1. Using Firebase Authentication (Recommended)** Firebase makes it easy to integrate social logins like Google and GitHub. ### **Step 1: Setup […]

Firebase Token to Laravel

User const getFirebaseToken = async (provider:string) => { try { // Sign in with Google or GitHub const result = provider === "google" ? await signInWithGoogle() : await signInWithGithub(); // Get Firebase ID token const idToken = await result.user.getIdToken(); // Log or return the token console.log("Firebase ID Token:", result.user); await nextTick(); router.push('/register'); return idToken; } […]

Firebase Login Issues

User we have successfully get respinse from firebase <script> import { ref,inject,onMounted } from "vue"; import { useForm, useField } from 'vee-validate' import { useAuthStore } from '@/stores/auth'; import { useRouter } from 'vue-router'; import publicApi from '@/publicApi'; import SingleColumn from '@/layouts/SingleColumn.vue'; import {signInWithGoogle, signInWithGithub} from '@/firebase'; import { useLoadingStore } from '@/stores/loading'; import { […]

Vuetify COOP Firebase Error

User <script> import { ref,inject,onMounted } from "vue"; import { useForm, useField } from 'vee-validate' import { useAuthStore } from '@/stores/auth'; import { useRouter } from 'vue-router'; import publicApi from '@/publicApi'; import SingleColumn from '@/layouts/SingleColumn.vue'; import {signInWithGoogle, signInWithGithub} from '@/firebase'; import { useLoadingStore } from '@/stores/loading'; import { nextTick } from "vue"; const loadingStore = […]