Skip to content

Instantly share code, notes, and snippets.

View oguzhanoptimum7's full-sized avatar
😎

Oğuzhan ÖZÇELİK oguzhanoptimum7

😎
View GitHub Profile
{"AddThisServiceButtonMeta":"","add_this":[{"annotation":"","service":"facebook"},{"annotation":"","service":"email"},{"annotation":"","service":"print"},{"annotation":"","service":"twitter"}],"add_to_wishlist_url":"/wishlist.php?action=add&product_id=135","availability":"Next Business Day Shipping!","brand":{"name":"Young Living","url":"/young-living-1/"},"bulk_discount_rates":[],"can_purchase":true,"cart_url":"/cart.php","category":["Razors & Shaving/Gillette/Mach3","Razors & Shaving","Razors & Shaving/Gillette"],"customizations":[],"description":"<h2>Gillette Mach3® Razor Blade Refills</h2><span style=\"font-style: normal; font-weight: bold;\"></span>\n<p>\n\t<span style=\"font-style: normal;\">The Original MACH3 blades continue its legacy of close comfortable shaves. With nano-thin blades and superior cartridge geometry, these indivially spring-mounted blades shave closely with zero redness*. </span><span>Still a \ntrusted choice, the Mach3 continues to give men around the world a great\n start to their d
@oguzhanoptimum7
oguzhanoptimum7 / blue.html
Last active February 21, 2022 11:35
blue-cookie-set
<script>
function setCookie(name,value,days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}
@oguzhanoptimum7
oguzhanoptimum7 / demo-description-eq-tuning.html
Created February 15, 2022 16:50
EQ Tuning Product Details
NOTE: You can create 1 to 10 sections for your content.
<div class="section-1">
<h4 class="section-1-header">Description</h4>
<div class="section-1-content">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
</div>
<div class="section-2">
{
"customer_id": "0",
"total_price": 750,
"products": [
{
"product_id": 1626064945242,
"variant_id": 15970312388698,
"price": "100.00",
"collections": [
"387524296"
@oguzhanoptimum7
oguzhanoptimum7 / demo-description.html
Last active January 7, 2022 14:31
Demo Description for products
<div class="section-1">
<h4 class="section-1-header">Description</h4>
<div class="section-1-content">
ANCORP’s ball valves consist of a body, stem, ball, and two end caps machined from corrosive resistant 316L stainless steel. Fluoroelastomers are used to seal the stem and end caps from atmosphere while the Teflon® seats cold flow around the ball to isolate the process when closed. The valve is opened and closed manually or pneumatically by ¼ turn, quick actuation. The Teflon® sealing surface helps to protect it from deposition, maintaining a clean dynamic seal to prevent failure due to contamination.
</div>
</div>
<div class="section-2">
<h4 class="section-2-header">Applications</h4>
<div class="section-2-content">
@oguzhanoptimum7
oguzhanoptimum7 / cart.php
Created December 16, 2021 14:17
Wordpress Woocommerce Information Product
// Get $product object from Cart object
$cart = WC()->cart->get_cart();
foreach( $cart as $cart_item_key => $cart_item ){
$product = $cart_item['data'];
// Now you have access to (see above)...
@oguzhanoptimum7
oguzhanoptimum7 / autocreate_custom_fields.php
Last active December 16, 2021 09:50
Wordpress Woocommerce Post Views Without Plugin
// ## AUTO CREATE CUSTUM FIELDS FOR VIEWS
add_action('publish_page', 'add_custom_field_automatically');
add_action('publish_post', 'add_custom_field_automatically');
add_action('publish_product', 'add_custom_field_automatically');
function add_custom_field_automatically($post_ID) {
global $wpdb;
if(!wp_is_post_revision($post_ID)) {
add_post_meta($post_ID, 'product_visit_count', 0, true);
}
}
@oguzhanoptimum7
oguzhanoptimum7 / remove.liquid
Created November 29, 2021 11:10 — forked from chrisjhoughton/remove.liquid
Remove a Shopify cart attribute
{% if cart.attributes.yourCartAttribute %}
<script>
$.ajax({
type: 'POST',
url: '/cart/update.js',
data: 'attributes[yourCartAttribute]=',
dataType: 'json'
});
</script>
{% endif %}
@oguzhanoptimum7
oguzhanoptimum7 / clear.js
Created November 29, 2021 11:09
Clear Cart Attr
$.ajax({
type: "GET",
url: '/cart.js',
dataType: 'json',
success: function(resp) {
var nullHash = {};
for ([key, value] of Object.entries(resp.attributes)) {
nullHash[key] = null;
}
$.ajax({
@oguzhanoptimum7
oguzhanoptimum7 / error.html
Created November 2, 2021 10:25
dyld: Library not loaded:
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.66.dylib Referenced from: /usr/local/bin/php Reason: image not found /usr/local/bin/valet: line 89: 42843 Abort trap: 6 php "DIR/cli/valet.php" "DIR/cli/valet.php""@" code example
Example: dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.66.dylib Referenced from: /usr/local/bin/node Reason: image not found
brew reinstall node
Credit: https://newbedev.com/javascript-dyld-library-not-loaded-usr-local-opt-icu4c-lib-libicui18n-66-dylib-referenced-from-usr-local-bin-php-reason-image-not-found-usr-local-bin-valet-line-89-42843-abort-trap-6-php-dir-cli-valet-php-code-example