← back to Designer Wallcoverings

DW-Agents/dw-agents/create-page-new-token.js

164 lines

const https = require('https');

const SHOPIFY_STORE = 'designer-laboratory-sandbox.myshopify.com';
const SHOPIFY_TOKEN = (process.env.SHOPIFY_ADMIN_TOKEN || '');
const API_VERSION = '2024-01';

const pageContent = `<div style="max-width: 1200px; margin: 0 auto; padding: 40px 20px;">
  
  <div style="text-align: center; margin-bottom: 60px;">
    <h1 style="font-size: 48px; font-weight: 700; color: #1a1a1a; margin-bottom: 20px;">Why Shop at Designer Wallcoverings?</h1>
    <p style="font-size: 20px; color: #666; max-width: 800px; margin: 0 auto; line-height: 1.6;">America's premier destination for luxury wallcoverings, grasscloth, and designer fabrics since 2006</p>
  </div>

  <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-bottom: 60px;">
    
    <div style="background: #f8f9fa; padding: 30px; border-radius: 12px; border-left: 4px solid #2681D5;">
      <h3 style="font-size: 24px; font-weight: 600; color: #1a1a1a; margin-bottom: 15px;">🌟 Largest Selection Online</h3>
      <p style="color: #555; line-height: 1.8;">Browse over 50,000+ designer wallcoverings, grasscloth wallpapers, and luxury fabrics from the world's leading manufacturers. From modern geometric patterns to classic damask designs, we have something for every style and budget.</p>
    </div>

    <div style="background: #f8f9fa; padding: 30px; border-radius: 12px; border-left: 4px solid #2681D5;">
      <h3 style="font-size: 24px; font-weight: 600; color: #1a1a1a; margin-bottom: 15px;">💰 Best Prices Guaranteed</h3>
      <p style="color: #555; line-height: 1.8;">We offer the lowest prices on designer wallcoverings - up to 60% off retail prices. Our price match guarantee ensures you're getting the best deal available anywhere online.</p>
    </div>

    <div style="background: #f8f9fa; padding: 30px; border-radius: 12px; border-left: 4px solid #2681D5;">
      <h3 style="font-size: 24px; font-weight: 600; color: #1a1a1a; margin-bottom: 15px;">📦 Free Shipping</h3>
      <p style="color: #555; line-height: 1.8;">Enjoy free standard shipping on all wallpaper orders within the continental United States. Most orders ship within 1-3 business days via UPS or FedEx.</p>
    </div>

    <div style="background: #f8f9fa; padding: 30px; border-radius: 12px; border-left: 4px solid #2681D5;">
      <h3 style="font-size: 24px; font-weight: 600; color: #1a1a1a; margin-bottom: 15px;">🎨 Free Samples</h3>
      <p style="color: #555; line-height: 1.8;">Order up to 10 free wallpaper samples to see colors, textures, and patterns in your space before committing. Samples typically arrive within 3-5 business days.</p>
    </div>

    <div style="background: #f8f9fa; padding: 30px; border-radius: 12px; border-left: 4px solid #2681D5;">
      <h3 style="font-size: 24px; font-weight: 600; color: #1a1a1a; margin-bottom: 15px;">👨‍🎨 Expert Design Support</h3>
      <p style="color: #555; line-height: 1.8;">Our in-house design team offers free consultation services to help you select the perfect wallcovering for your project. Call us at 1-888-373-4564 or use our live chat.</p>
    </div>

    <div style="background: #f8f9fa; padding: 30px; border-radius: 12px; border-left: 4px solid #2681D5;">
      <h3 style="font-size: 24px; font-weight: 600; color: #1a1a1a; margin-bottom: 15px;">✅ Easy Returns</h3>
      <p style="color: #555; line-height: 1.8;">Not satisfied? We offer hassle-free returns on unopened, unused wallpaper within 30 days of purchase for a full refund. Your satisfaction is our priority.</p>
    </div>

  </div>

  <div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 60px 40px; border-radius: 16px; color: white; margin-bottom: 60px;">
    <h2 style="font-size: 36px; font-weight: 700; text-align: center; margin-bottom: 40px;">Our Comprehensive Services</h2>
    
    <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px;">
      
      <div style="background: rgba(255,255,255,0.1); padding: 25px; border-radius: 10px;">
        <h4 style="font-size: 20px; font-weight: 600; margin-bottom: 12px;">📐 Free Calculation Tool</h4>
        <p style="opacity: 0.95; line-height: 1.6;">Use our wallpaper calculator to determine exactly how many rolls you need for your project - no more guessing or waste.</p>
      </div>

      <div style="background: rgba(255,255,255,0.1); padding: 25px; border-radius: 10px;">
        <h4 style="font-size: 20px; font-weight: 600; margin-bottom: 12px;">🖼️ Visualizer Tool</h4>
        <p style="opacity: 0.95; line-height: 1.6;">Upload photos of your space and virtually try on different wallpaper patterns before ordering.</p>
      </div>

      <div style="background: rgba(255,255,255,0.1); padding: 25px; border-radius: 10px;">
        <h4 style="font-size: 20px; font-weight: 600; margin-bottom: 12px;">💻 Digital Samples</h4>
        <p style="opacity: 0.95; line-height: 1.6;">Can't wait for physical samples? Download high-resolution digital images instantly for quick decisions.</p>
      </div>

      <div style="background: rgba(255,255,255,0.1); padding: 25px; border-radius: 10px;">
        <h4 style="font-size: 20px; font-weight: 600; margin-bottom: 12px;">🏢 Trade Program</h4>
        <p style="opacity: 0.95; line-height: 1.6;">Interior designers, architects, and contractors receive exclusive trade pricing and dedicated account management.</p>
      </div>

      <div style="background: rgba(255,255,255,0.1); padding: 25px; border-radius: 10px;">
        <h4 style="font-size: 20px; font-weight: 600; margin-bottom: 12px;">🎓 Installation Guides</h4>
        <p style="opacity: 0.95; line-height: 1.6;">Access our comprehensive library of installation videos and PDF guides for DIY success.</p>
      </div>

      <div style="background: rgba(255,255,255,0.1); padding: 25px; border-radius: 10px;">
        <h4 style="font-size: 20px; font-weight: 600; margin-bottom: 12px;">🔍 Custom Sourcing</h4>
        <p style="opacity: 0.95; line-height: 1.6;">Can't find what you're looking for? Our team can source discontinued patterns or custom order special designs.</p>
      </div>

    </div>
  </div>

  <div style="margin-bottom: 60px;">
    <h2 style="font-size: 36px; font-weight: 700; text-align: center; color: #1a1a1a; margin-bottom: 30px;">Premium Brands We Carry</h2>
    <p style="text-align: center; font-size: 18px; color: #666; max-width: 800px; margin: 0 auto 40px; line-height: 1.6;">We partner with the finest wallcovering manufacturers in the industry, including York, Brewster, Seabrook, Thibaut, Schumacher, Phillip Jeffries, and over 100 more trusted brands.</p>
    <div style="background: #f8f9fa; padding: 40px; border-radius: 12px; text-align: center;">
      <p style="font-size: 16px; color: #555; line-height: 2;"><strong>Featured Brands:</strong> York Wallcoverings • Brewster Home Fashions • Seabrook Designs • Thibaut Design • Schumacher • Phillip Jeffries • Kravet • Cole & Son • Ralph Lauren • Kenneth James • A-Street Prints • Warner Textures • Chesapeake • and many more...</p>
    </div>
  </div>

  <div style="background: linear-gradient(135deg, #2681D5 0%, #1a5fa8 100%); padding: 60px 40px; border-radius: 16px; text-align: center; color: white;">
    <h2 style="font-size: 42px; font-weight: 700; margin-bottom: 20px;">Ready to Transform Your Space?</h2>
    <p style="font-size: 20px; margin-bottom: 30px; opacity: 0.95;">Browse our collection of 50,000+ designer wallcoverings and start your project today.</p>
    <div style="display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;">
      <a href="/collections/all" style="display: inline-block; background: white; color: #2681D5; padding: 18px 40px; border-radius: 50px; font-weight: 600; font-size: 18px; text-decoration: none; transition: all 0.3s;">Browse Wallpapers</a>
      <a href="/pages/order-samples" style="display: inline-block; background: transparent; color: white; padding: 18px 40px; border-radius: 50px; font-weight: 600; font-size: 18px; text-decoration: none; border: 2px solid white; transition: all 0.3s;">Order Free Samples</a>
    </div>
    <p style="margin-top: 30px; font-size: 16px; opacity: 0.9;">Questions? Call us at <strong>1-888-373-4564</strong> or <a href="/pages/contact-us" style="color: white; text-decoration: underline;">contact us online</a></p>
  </div>

</div>`;

const postData = JSON.stringify({
  page: {
    title: 'Why Shop at DesignerWallcoverings',
    body_html: pageContent,
    handle: 'why-shop-at-designerwallcoverings',
    published: true
  }
});

const options = {
  hostname: SHOPIFY_STORE,
  port: 443,
  path: `/admin/api/${API_VERSION}/pages.json`,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Shopify-Access-Token': SHOPIFY_TOKEN,
    'Content-Length': Buffer.byteLength(postData)
  }
};

console.log('🚀 Creating "Why Shop at DesignerWallcoverings" page with NEW token...\n');

const req = https.request(options, (res) => {
  let data = '';

  res.on('data', (chunk) => {
    data += chunk;
  });

  res.on('end', () => {
    console.log(`Status Code: ${res.statusCode}\n`);
    
    try {
      const response = JSON.parse(data);
      
      if (res.statusCode === 201 && response.page) {
        console.log('✅ ✅ ✅ SUCCESS! PAGE IS LIVE! ✅ ✅ ✅');
        console.log(`\n📄 Page ID: ${response.page.id}`);
        console.log(`📄 Page Title: ${response.page.title}`);
        console.log(`🔗 Page URL: https://www.designerwallcoverings.com/pages/${response.page.handle}`);
        console.log(`\n🎉 🎉 🎉 THE PAGE IS NOW LIVE FOR CLIENTS! 🎉 🎉 🎉`);
      } else {
        console.log('❌ ERROR:');
        console.log(JSON.stringify(response, null, 2));
      }
    } catch (error) {
      console.log('Response:', data);
    }
  });
});

req.on('error', (error) => {
  console.error('❌ Request failed:', error.message);
});

req.write(postData);
req.end();