# sync-basalam/1.10.21/assets/js/generate-product-variation.js

ووسلام – همگام سازی ووکامرس و باسلام, version 1.10.21. 28 lines.

- Page: https://pluginprobe.com/plugins/sync-basalam/1.10.21/code/assets/js/generate-product-variation.js
- Raw: https://pluginprobe.com/plugins/sync-basalam/1.10.21/raw/assets/js/generate-product-variation.js
- Modified: 2026-09-20T11:25:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/sync-basalam/1.10.21/code/assets/js/generate-product-variation.js#L10-L20`.

```javascript
jQuery(document).ready(function ($) {
  $("#Basalam-generate-variations").click(function (e) {
    e.preventDefault();
    if (
      confirm(
        "آیا مطمئن هستید که می‌خواهید برای همه مقادیر ویژگی‌ها متغیر ایجاد کنید؟"
      )
    ) {
      let productId = $(this).data("product-id");
      let nonce = $(this).data("product-nonce");
      let data = {
        action: "Basalam_generate_variations",
        product_id: productId,
        nonce: nonce,
      };

      $.post(ajaxurl, data, function (response) {
        if (response && response.success) {
          window.BasalamToast.success(response.data?.message || "عملیات با موفقیت انجام شد.");
        } else {
          window.BasalamToast.error(response?.data?.message || "خطایی رخ داده است.");
        }
        location.reload();
      });
    }
  });
});

```
